Parameter error
This is an open discussion with 3 replies, filed under XSLT.
Search
XSLT doesn’t like it if you check for variables/params that don’t exist. You need to add a blank fallback variable somewhere in your template stylesheet (outside the template):
<xsl:variable name="page"/>
I think what I’m after is some kind of isset() function like in PHP. I need to achieve the following:
if $handle
is equal to $current-page
and
if $page
parameter exists, check that it has no value
Is this possible?
Oh, missed that! Cheers!
Yep, it fixed it, thanks @makenosound…
Create an account or sign in to comment.
I’m doing the following in my xsl template
Which, if the parameter isn’t available (as it is a url parameter) get the following error
What I’m trying to do with the if statement is to see whether the
$page
parameter is not set, i.e. null. The error is being thrown as on some pages, the$page
parameter is not even declared as it isn’t an url parameter for that page.Does anyone know how I should write this if statement correctly? It’s probably really simple, I haven’t slept in 24hrs…