It's defined in the start of the xslt: <xsl:variable name="productName" select="teacommerce:GetProperty($variant, 'productName')" />
But it doesn't make a difference if I remove the alt and title values.
It display the altImage on product page if a place a single image outside the for-each just the same way as on product list.. There is no problem with displaying the images in for-each: http://sub.ak-security.dk/da/shop/radioer-plus-tilbehoer/tyt-th-f6-radio.aspx but the altImage doesn't seem to work there.
Is it the exact same XSLT rendering you're using in the two views? the altimage attribute is never written to the source on the view with the related products.
Could you perhaps post all the XSLT you're using to generate the related products view?
it's the product image I have a problem with ... the relatedProducts.xslt is called into the product_product.xslt file... and it seems to work on related products with altImage.. I just changed it from the default "hello world" text to an altImage: http://sub.ak-security.dk/da/shop/radioer-plus-tilbehoer/tyt-th-f6-radio.aspx
Forgive me being a bit slow on this - finally I get what you mean.
But doesn't it make sense that no images are being shown at all? I mean you're looping over all the "Image" types...but if no images is selected it won't loop over any of them, right?
I guess you need to do a count()...like this...
<xsl:choose> <xsl:when test="count(./productImage/DAMP/mediaItem/Image) = '0'> <!-- call your alt image here --> </xsl:when> <xsl:otherwise> <!-- your loop here --> </xsl:otherwise> </xsl:choose>
Heh.. perhaps I wasn't precise enough on what I meant :)
I think it's because I use Image in for-each: ./productImage/DAMP/mediaItem/Image ... when I replace that with just ./productImage I also get the altImage.. but then of cource not the selected image with DAMP. It also make sense, cause when no images is selected, there are no Images to loop and therefore I don't get any output inside the <ul> tags...
So I think the easist way is to do the for-each on ./productImage ... and then I have removed ./DAMP/mediaItem/Image from the for-each and pasted it before umbracoFile, umbracoWidth, umbracoHeight inside the loop.. and then it works :)
AltImage not showing in for-each
Hi..
I have a problem with the altImage not is showing when it's inside a loop..
The altImage is shown in the product list here: http://sub.ak-security.dk/da/shop/radioer-plus-tilbehoer.aspx
on product page the image is shown if I have chosen one, but not if I haven't chosen an image:
http://sub.ak-security.dk/da/shop/radioer-plus-tilbehoer/tyt-th-f6-radio.aspx (with image)
http://sub.ak-security.dk/da/shop/radioer-plus-tilbehoer/motorola-radio.aspx (without image chosen)
Bjarne
Hi Bjarne
Where in the code do you define the $productName variable?
/Jan
Hi Jan..
It's defined in the start of the xslt:
<xsl:variable name="productName" select="teacommerce:GetProperty($variant, 'productName')" />
But it doesn't make a difference if I remove the alt and title values.
It display the altImage on product page if a place a single image outside the for-each just the same way as on product list..
There is no problem with displaying the images in for-each: http://sub.ak-security.dk/da/shop/radioer-plus-tilbehoer/tyt-th-f6-radio.aspx but the altImage doesn't seem to work there.
Bjarne
Hi Bjarne
Sorry, #h5is! Read it wrong.
Is it the exact same XSLT rendering you're using in the two views? the altimage attribute is never written to the source on the view with the related products.
Could you perhaps post all the XSLT you're using to generate the related products view?
/Jan
Hi Jan
it's the product image I have a problem with ... the relatedProducts.xslt is called into the product_product.xslt file... and it seems to work on related products with altImage.. I just changed it from the default "hello world" text to an altImage: http://sub.ak-security.dk/da/shop/radioer-plus-tilbehoer/tyt-th-f6-radio.aspx
On that page the image is displayed, but not on pages with no image chosen: http://sub.ak-security.dk/da/shop/radioer-plus-tilbehoer/motorola-radio.aspx
The related products get the image this way:
The product image:
Bjarne
Hi Bjarne
Forgive me being a bit slow on this - finally I get what you mean.
But doesn't it make sense that no images are being shown at all? I mean you're looping over all the "Image" types...but if no images is selected it won't loop over any of them, right?
I guess you need to do a count()...like this...
<xsl:choose>
<xsl:when test="count(./productImage/DAMP/mediaItem/Image) = '0'>
<!-- call your alt image here -->
</xsl:when>
<xsl:otherwise>
<!-- your loop here -->
</xsl:otherwise>
</xsl:choose>
Hope this helps.
/Jan
Heh.. perhaps I wasn't precise enough on what I meant :)
I think it's because I use Image in for-each: ./productImage/DAMP/mediaItem/Image ... when I replace that with just ./productImage I also get the altImage.. but then of cource not the selected image with DAMP. It also make sense, cause when no images is selected, there are no Images to loop and therefore I don't get any output inside the <ul> tags...
So I think the easist way is to do the for-each on ./productImage ... and then I have removed ./DAMP/mediaItem/Image from the for-each and pasted it before umbracoFile, umbracoWidth, umbracoHeight inside the loop.. and then it works :)
Thanks for your help Jan and happy new year :)
Bjarne
Hi Bjarne
I'm glad to see you're able to move on :)
And a very happy new year to you as well!
/Jan
is working on a reply...