Search

Here’s my XSLT:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="../utilities/master.xsl"/>

<xsl:param name="location"/>

<xsl:template match="data">

<xsl:choose>
    <xsl:when test="$location">
        <h1>Location</h1>
    </xsl:when>
    <xsl:otherwise>
        <h1>About Us</h1>
    </xsl:otherwise>
</xsl:choose>

</xsl:template>

</xsl:stylesheet>

The page has ‘location’ defined as a URL param and it’s filtering my datasource as it should but when I try the page with a location defined it doesn’t show the new H1.

I’m sure it’s something stupid I’m missing. I’m used to putting “not($entry)” and so forth but I’m planning on having more URL params so that’s not really an option this time.

<xsl:when test="$location">

Try this instead:

<xsl:when test="not($location = '')">

I found the problem. My XSLT was fine, the issue was how I was defining URL parameters in Symphony.

I had location, counselor and so forth when I needed location/counselor instead.

I knew it was something stupid. Thanks for the assist!

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