View Full Version : Can Act_productimage.html netquotevar:alternatetext display full description?
skinnybloke
07-Nov-2003, 01:59 PM
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
cdicken
12-Nov-2003, 02:56 PM
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.
NormanRouxel
12-Nov-2003, 03:20 PM
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
cdicken
12-Nov-2003, 03:35 PM
valid within the ProductImage template
But it is valid in the product layout (ProductLine) template.
NormanRouxel
12-Nov-2003, 03:45 PM
Here's a (cludgy) way that seems to work.
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
NormanRouxel
12-Nov-2003, 03:50 PM
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
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.