Search

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"?

Try something like this:

<xsl:if test="count(portfolio-images) &gt; 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) &gt; 1"><a href="#gallery">more</a></xsl:if>

Edit: @sirlancelot, you were too fast for me.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details