Count the number of entries
This is an open discussion with 2 replies, filed under XSLT.
Search
Try something like this:
<xsl:if test="count(portfolio-images) > 1"> <a href="link-to-more-images/">More</a> </xsl:if>
Inside the if
block you would place your link. You will need to modify the count()
argument to the XPath of your portfolio images.
Not knowing what your XML looks like, I'm just guessing:
<xsl:if test="count(/data/portfolio-images/entry) > 1"><a href="#gallery">more</a></xsl:if>
Edit: @sirlancelot, you were too fast for me.
Create an account or sign in to comment.
I have a portfolio section with a portfolio-images section linked to it. Some portfolio entries have one image, others have multiple images. Is there any way so that for the entries with multiple entries, I can display a link on the bottom of that entry that says "more"?