Search

I've got a data source set up that can filter by the title of an entry. Now when it's showing all of the entries I want to show one set of content for each entry but when it's filtering down to a single entry I want it to show some more content.

How would I achieve this? I seem to remember an if statement that allows you to test the URL but I can't remember it or find an example.

do you have a param set up in your url string when you filter down to a single entry? i would imagine you would to achieve the filtering. using the var entry to filter to a single post, you can try this to show/hide content based on page:

<xsl:choose>
    <xsl:when test="not($entry)">
        <!-- don't show the content -->
    </xsl:when>
    <xsl:otherwise>
        <!-- show the content -->
    </xsl:otherwise>
</xsl:choose>

I think that will work, but not 100% sure if the XSLT processor will throw a fit if you don't have $entry defined in your page, even though you're telling it when the $entry is not defined.

that's just one approach, but i'm sure there are other options.

Works! Thanks!

not a problem =)

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