Search

Guys, i can’t understand the following condition. say, the debug output of my current page claims that:

$root-page = ‘drinks’ — good

$current-page = ‘articles’ — good

$current-path = ‘/drinks/articles/49/?debug=params’ — wtf?

shouldn’t the last one equals just to ‘/drinks/articles/49/’

Ok, i’ve created a special variable ‘$page-path’, stripping all the unnecessary stuff in my master.xsl. but how can i inject this var into the global parameters pool? so that one could watch it amongst other global parameters?

Are you getting these values from the debug params page? If so, the current-path value is correct, because that is where you are.

$current-path = ‘/drinks/articles/49/?debug=params’ — wtf?

This is correct. Think about it — to get to the debug page you’ve appended ?debug=params onto the end of the URL. When you’re not viewing the debug page the value would be /drinks/articles/49/ as expected.

Ok, i’ve created a special variable ‘$page-path’, stripping all the unnecessary stuff in my master.xsl. but how can i inject this var into the global parameters pool? so that one could watch it amongst other global parameters?

Are you creating this “special variable” using XSLT? If so, you cannot add this to the global parameter pool. The param pool is created before your XSLT runs. In fact it is the set of parameters that it passed into the XSLT transformation for you to use in your code. Because your own XSLT runs after the param pool has been created, you can’t use XSLT to pass parameters back into the pool.

If you declare this variable in your master.xsl outside of any xsl:template then this will be available to all of your pages.

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