I'm trying to get a 'related products' macro to work. It's shown on a product detail page, and lists out a small selection of other products in the same category, in a random order. It's all working except for trying to filter so it won't show the product you're currently viewing in the related products.
I think my issue is in the test I'm trying to do in the for-each loop -
multiple and in for-each loop? Syntax help
I'm trying to get a 'related products' macro to work. It's shown on a product detail page, and lists out a small selection of other products in the same category, in a random order. It's all working except for trying to filter so it won't show the product you're currently viewing in the related products.
I think my issue is in the test I'm trying to do in the for-each loop -
This works:
<xsl:for-each select="$currentPage/ancestor::*/* [ string(umbracoNaviHide) != '1' and
name() = 'Product' ] ">
But trying to add a test for 'not including the current page' this doesn't return any nodes:
<xsl:for-each select="$currentPage/ancestor::*/* [ string(umbracoNaviHide) != '1' and
name() = 'Product' and @id != current()/@id] ">
If anyone could point out where I'm going wrong with this I'd really appreciate it.
Hi aaronb,
Try something like this:
/Chriztian
is working on a reply...