which works.... so i now want to check two conditions. Second condition is if the for each has multiple items the to get one, so created a variable to hold the value
<xsl:variable name="items" select="1" />
So i would like one item to be returned regardless of the number of items. My code now is
<xsl:if test="image !=''" and (< $items)>
but get an error. How should i be checking these multiple conditions?
Multiple If statement
Im trying to get one image back from a media library (but same procedure would be used against other items i.e. News).
So heres the code i have
<xsl:for-each select="umbraco.library:GetXmlNodeById(1)/descendant::* [@isDoc]">
<xsl:if test="image !=''">
which works.... so i now want to check two conditions. Second condition is if the for each has multiple items the to get one, so created a variable to hold the value
<xsl:variable name="items" select="1" />
So i would like one item to be returned regardless of the number of items. My code now is
<xsl:if test="image !=''" and (< $items)>
but get an error. How should i be checking these multiple conditions?
Thanks
Hi J,
Am I right in thinking that you want to render the first X items that has an image, regardless how many there are?
If so, try this:
Otherwise, let us know what you're trying to achieve—
/Chriztian
is working on a reply...