What do you do when a programmer that previously worked on your Umbraco project chose to use XSLT (1.0) for the generation of al header content and now you have to read a query string parameter and change the title of the page, IF and only if you're on a page with the "foo" document type alias?
I don't have the slightest clue on how to do this and my only option at the moment is rewriting the code to C#.
Could you help out? Right now I can print the id of the current document's type, like this:
<xsl:value-of select ="$currentPage/@nodeType" />
What I need next is
- fetch the document type alias in some way (is this possible in xslt? To my knowledge document types are not part of the xml cache, which means I would have to use an extension??) and test if it is "foo".
- Check if the query string parameter "title" exists.
- If the previous two conditions are both true, I want to use the value of the title parameter as the title of the page.
Checking query string parameters from XSLT?
What do you do when a programmer that previously worked on your Umbraco project chose to use XSLT (1.0) for the generation of al header content and now you have to read a query string parameter and change the title of the page, IF and only if you're on a page with the "foo" document type alias?
I don't have the slightest clue on how to do this and my only option at the moment is rewriting the code to C#.
Could you help out? Right now I can print the id of the current document's type, like this:
<xsl:value-of select ="$currentPage/@nodeType" />
What I need next is
- fetch the document type alias in some way (is this possible in xslt? To my knowledge document types are not part of the xml cache, which means I would have to use an extension??) and test if it is "foo".
- Check if the query string parameter "title" exists.
- If the previous two conditions are both true, I want to use the value of the title parameter as the title of the page.
Your help will be much appreciated :-)
Try using this extension:
http://our.umbraco.org/wiki/reference/umbracolibrary/requestquerystring
It should be pretty straight forward ...
That was pretty simple. Thanks.
is working on a reply...