How can I harcode the product image width and height in the xml package so that it renders in the html source?
Our images html code are: <img src="images/xxxxx.jpg" alt="whatever">
There is no width and height.
Can somebody please help?
How can I harcode the product image width and height in the xml package so that it renders in the html source?
Our images html code are: <img src="images/xxxxx.jpg" alt="whatever">
There is no width and height.
Can somebody please help?
Something like this in the XML package (typing directly so might need fixing slightly)
<img src="[url of the image]" alt="[title of the image]">
<xsl:attribute name="width">[put width here]</xsl:attribute>
<xsl:attribute name="height">[put height here]</xsl:attribute>
</img>
Webopius.com: ASPDotNetStorefront web development and ecommerce project management
Webopius is now a Sage Pay Approved Partner
I should have posted the tag that we have in the xml package to display the image:
<xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'icon', 1, $AltText)" disable-output-escaping="yes"/>
I am not sure if your solution will work here
That's fine. Just use aspdnsf:ProductImageUrl() instead so that you get full control... something like this (again, I'm typing without looking at code so it may need correcting)
<img alt="[title of the image]">
<xsl:attribute name="src">
<xsl:value-of select="aspdnsf:ProductImageUrl(ProductID, ImageFilenameOverride, SKU, 'icon', 0)" disable-output-escaping="yes"/>
</xsl:attribute>
<xsl:attribute name="width">[put width here]</xsl:attribute>
<xsl:attribute name="height">[put height here]</xsl:attribute>
</img>
Webopius.com: ASPDotNetStorefront web development and ecommerce project management
Webopius is now a Sage Pay Approved Partner
I got it! :-)
Here is my code after some adjustments:
Code:<a href="{aspdnsf:ProductLink(ProductID, SEName, 0, '')}"> <img> <xsl:attribute name="alt"><xsl:value-of select="aspdnsf:GetMLValue(Name)" /></xsl:attribute> <xsl:attribute name="src"> <xsl:value-of select="aspdnsf:ProductImageUrl(ProductID, ImageFilenameOverride, SKU, 'icon', 0)" disable-output-escaping="yes"/> </xsl:attribute> <xsl:attribute name="width">150</xsl:attribute> <xsl:attribute name="height">150</xsl:attribute> </img> </a>
Thanks a lot!!!!