Announcement

Collapse
No announcement yet.

Truncating info

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Truncating info

    Hi everyone,

    Wondered if anyone had any ideas on solving the simple problem below

    I wish to truncate the long description on my search results page page, and make that text link to my popup, for that product.

    Any ideas on this?

    Regards
    Chris

    #2
    Hmmm... not that simple I'm afraid.

    I actually don't know of any way to do this. I guess your 'truncation' idea would be restricting to a certain number of characters. I will request this as a wish list item.

    With regards to the extended info pop-ups, this information is not added to the search index so there is no way to include this information in the results.

    Sorry about that.

    Comment


      #3
      Hi Chris,

      I explained myself poorly i'm afraid, what i called search result page is in fact what you refer to as product page,

      And therefore in that page you do include the popup details as you can have a button which links to the popup,

      My only query is how to give my text(hopefully truncated by then) the same link attributes as the button created by actinic.

      I hope this makes it clearer,

      On the other point If anyone out there has any idea on how to easily truncate text using javascript within a table please let me know.


      Thanks
      Chris Marques

      Comment


        #4
        There is no way to templates to put the 'Extended Info' hyperlinks around the full description. Sorry about that.

        What you can do, however, is to use custom properties to create the link to the pop-up window.

        To begin, go into 'Advanced | Define Custom Properties'. Create a new custom property called 'URL'.

        Now open up 'Act_ProductLine.html' (or whatever Product Layout template(s) you are using) and replace

        NETQUOTEVAR:PRODUCTDESCRIPTION

        with

        <A HREF="javascript:ShowPopUp('CUSTOMVAR:URL',500,400)">NETQUOTEVAR:PRODUCTDESCRIPTION</A>

        You can now go into each of your products (or sections) and specify a value for 'URL' as follows:

        1. Double click a product or section.

        2. Within the Advanced view, click on "Properties" and click the "+" symbol to specify a new variable value.

        3. Now select "URL" from the drop-down menu, and enter a complete URL in the 'value' field e.g. http://www.mysite.com/index.html

        Note:
        You can also create custom properties for the width and height if you want them to be different for each product.

        Comment


          #5
          I explained myself poorly i'm afraid, what i called search result page is in fact what you refer to as product page..
          If you're saying that you want only to display a limited amount of product description text on the product page but to actually have more words there (presumably so it can be included in search terms) then it can be done like this

          Visible text here !!<<noscript>>!!Invisible text here!!<</noscript>>!!

          Norman.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Thank you both for your help,
            Regarding the link to the extended popup link, i believe You covered it Chris, thanks.

            Regarding the truncating of the information here is what I would like to do exactly,

            1.I display my products in Rows,each showing in columns:
            -Short Description first
            -Long description
            -Finnally the price.

            What I want is to include in my Long description cell, a script which will allow me to control a set amount of characters(let's say 40 characters) to be shown of the long description, then using Chris link idea above and a couple of other tweaks to allow for the Cut down long description to be hyperlinked to the Product popup for more information...


            I hope you managed to follow me on this one Norman, I can think it but can't perfectly explain it I'm afraid.

            Kind regards
            Chris Marques
            And once again your help is greatly appreciated.

            PS: Norman, your first Idea only works if I want to hard code the noscript tag in every long description whereas I want to dynamically cut down the string as the page is rendered, hopefully this will explain it better.

            Comment


              #7
              Here are two possible ways:-

              1: Replace NETQUOTEVAR:PRODUCTDESCRIPTION with:-

              Code:
              <script language=JavaScript>
              document.write('NETQUOTEVAR:PRODUCTDESCRIPTION'.substring(0,40) + '...');
              </script>
              this gives you truncated text with a few dots appended. You might want to enhace this code so that it doesn't truncate in the middle of an HTML escape code sequence (Actinic replaces special characters with their equivelant escape codes).

              2: Replace NETQUOTEVAR:PRODUCTDESCRIPTION with:-

              Code:
              <textarea readonly style="{font-family: arial; border: none; width: 300; height: 20;}">NETQUOTEVAR:PRODUCTDESCRIPTION</textarea>
              This places the entire description within a tiny text area window with a pair of scrollbars that allows the entire text to be viewed if required. No problem with escape codes as the entire text is displayed (but only some of it is visible at one time).

              Norman
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Thank you very much for the help the whole thing is behaving as expected...
                Thanks Chris,
                and thank you Norman...


                Chris Marques

                Comment


                  #9
                  Here's an update that deals with some minor niggles.

                  1: Replace NETQUOTEVAR:PRODUCTDESCRIPTION with:-

                  Code:
                  <script language=JavaScript>
                  document.write('NETQUOTEVAR:PRODUCTDESCRIPTION'.substring(0,40) + '...');
                  </script>
                  This gives you truncated text with a few dots appended.
                  You might want to enhance this code so that it doesn't truncate in the middle of an HTML escape code sequence
                  (Actinic replaces special characters with their equivalent escape codes).

                  The following code seems to do it and also removes any truncated HTML tags (like <BR> or <P>).

                  Code:
                  <script language=JavaScript>
                  document.write((('NETQUOTEVAR:PRODUCTDESCRIPTION'.substring(0,40)).replace(/&#*\d{0,3}$/,"")).replace(/<[^>]*$/,"") + '...');
                  </script>


                  2: Replace NETQUOTEVAR:PRODUCTDESCRIPTION with:-

                  Code:
                  <textarea readonly style="{font-family: arial; border: none; width: 300; height: 20;}">NETQUOTEVAR:PRODUCTDESCRIPTION</textarea>
                  This places the entire description within a tiny text area window with a pair of scrollbars that
                  allows the entire text to be viewed if required.
                  No problem with truncated escape codes as the entire text is displayed
                  (but only some of it is visible at one time).
                  However the source of HTML <BR> and <P> tags are visible.

                  Using this alternative code will fix this.

                  Code:
                  <script language=JavaScript>
                  document.write('<textarea readonly style="{font-family: arial; border: none; width: 300; height: 20;}">');
                  document.write('NETQUOTEVAR:PRODUCTDESCRIPTION'.replace(/<p>|<br>/ig,"\n"));
                  document.write('</textarea>');
                  </script>
                  Norman
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment

                  Working...
                  X