Newbie so please bare with me, I have two varibles products and productscat. I which to display a product listing based upon a search filter. I can get a listing out for one by <xsl:for-each select="$products"> but how do I combine both variables so they both contribute to the listing, something like <xsl:for-each select="concat($products, $productscat)"> .. this doesn't work but along these lines?
Hi. If you want to pass these to variables to an XSLT macro neither have you to mix nor combine them in any way. Just declare two separate macro parameters for instance aliased "products" and "productCat" and pass them to a macro as parameters (e.g. <umbraco:macro runat="server" Alias="MyMacro" products="foo" productCat="bar"/>). Then inside your xslt you can access them separately with XPath:
two variables search
Newbie so please bare with me, I have two varibles products and productscat. I which to display a product listing based upon a search filter. I can get a listing out for one by <xsl:for-each select="$products"> but how do I combine both variables so they both contribute to the listing, something like <xsl:for-each select="concat($products, $productscat)"> .. this doesn't work but along these lines?
Hi. If you want to pass these to variables to an XSLT macro neither have you to mix nor combine them in any way. Just declare two separate macro parameters for instance aliased "products" and "productCat" and pass them to a macro as parameters (e.g. <umbraco:macro runat="server" Alias="MyMacro" products="foo" productCat="bar"/>). Then inside your xslt you can access them separately with XPath:
Hi Chris,
To combine nodesets you use a pipe character (concat() is for strings only):
/Chriztian
Great Thanks Christian, applying that principle on another part of the code fixed the issue. cheers
is working on a reply...