Search

I have data that should only show up on pages that have no 'entry'-URL Parameter. It's just like the opposite of symphony's default 'article'-page and 'article'-ds, which displays an article only when there is a 'entry'-parameter.

I tried something like

<xsl:if test="$entry = ''">
  ...show the data...
</xsl:if>

,but this don't work. I have the data souce connected with several pages, and some of them don't have an 'entry'-parameter. Those pages throw errors because they can't test on a parameter which doesn't exist...

How do I negate the 'entry'-parameter?

How about test="$entry"?

For those pages that you are using to test the value of a parameter, you need to declare them in your templates. You can add this to a master template:

<xsl:param name="entry"/>

Then you can override the value in the templates that you call.

And you may want to try something like this:

<xsl:if test="not($entry)">

I have data that should only show up on pages that have no 'entry'-URL Parameter.

You can either use bauhouse's method of declaring a global param, or else you'll need to create a new page for that data instead. Both are compromises and not ideal, however it might be reassuring to know that there's a better solution to this planned for RC1.

Thanks for the answers. I'll stick with bauhouse's 'workaround' until RC1!

Can't wait:

booker

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