Announcement

Collapse
No announcement yet.

Can Act_productimage.html netquotevar:alternatetext display full description?

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

    Can Act_productimage.html netquotevar:alternatetext display full description?

    Hi - Act_productiame.html has a parameter netquotevar:alternatetext for displaying alternate text when you hover over a product image. Looking at the manual it says that it uses the products short description.

    Can anything be modified to display the full description of a product in it's place?

    TIA
    Regards
    David

    #2
    You can replace NETQUOTEVAR:PRODUCTIMAGE in the product layout template with:

    <IMG SRC="NETQUOTEVAR:IMAGEFILE"
    ALT="NETQUOTEVAR:PRODUCTDESCRIPTION"
    BORDER=0
    NETQUOTEVAR:IMAGEHEIGHT
    NETQUOTEVAR:IMAGEWIDTH
    >

    ... which does the job nicely.

    Comment


      #3
      Unfortunately that doesn't work (on 6.1.3) as NETQUOTEVAR:PRODUCTDESCRIPTION isn't valid within the ProductImage template.

      This save some grief as NETQUOTEVAR:PRODUCTDESCRIPTION generates <br> or <p> tags for new lines in the description text and these would break the <IMG...> tag.

      Also I believe that there are limits on how big an ALT field can be, and this might also break your images if you had long descriptions on some products.

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

      Comment


        #4
        valid within the ProductImage template
        But it is valid in the product layout (ProductLine) template.

        Comment


          #5
          Here's a (cludgy) way that seems to work.

          Code:
          In Act_ProductLine.html (and all other Product templates you're using), just after NETQUOTEVAR:PRODUCTFORMBEGIN add the lines
          
          <script language=JavaScript>
          <!--
          var alttext = 'NETQUOTEVAR:PRODUCTDESCRIPTION'.replace(/<BR>|<P>/g,"\n"); // replace <BR> or <P> with newline
          alttext = alttext.replace(/<.*>/g,"");			          // remove all other HTML tags
          // -->
          </script>
          
          
          
          And replace Act_ProductImage.html with the following
          
          
          <!-- ProductImage HTML begin -->
          <!-- This file is used to build the product image markup. -->
          
          <script language=JavaScript>
          <!--
          document.write('<IMG SRC="NETQUOTEVAR:IMAGEFILE" ALT="' + alttext + '" ');
          document.write('BORDER=0 NETQUOTEVAR:IMAGEHEIGHT NETQUOTEVAR:IMAGEWIDTH NETQUOTEVAR:OTHERIMAGEMARKUP>');
          // -->
          </script>
          <NOSCRIPT><IMG SRC="NETQUOTEVAR:IMAGEFILE"
          	  ALT="NETQUOTEVAR:ALTERNATETEXT"
          	  BORDER=0
          	  NETQUOTEVAR:IMAGEHEIGHT
          	  NETQUOTEVAR:IMAGEWIDTH
          	  NETQUOTEVAR:OTHERIMAGEMARKUP>
          </NOSCRIPT>
          
          <!-- This file is used to build the product image markup. -->
          <!-- ProductImage HTML end -->

          This seems to work but I'm not sure what will happen with extremely long descriptions. My HTML reference says that there may be a limit of 1024 chars in alt text, but that in theory it's unlimited.

          Norman

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

          Comment


            #6
            But it is valid in the product layout (ProductLine) template.
            Ooops. Sorry Chris I missed that bit. However the new lines and any other HTML in the description still break it.


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

            Comment

            Working...
            X