Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • julius 107 posts 289 karma points
    Aug 21, 2011 @ 23:41
    julius
    0

    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 :-)

  • Sebastian Dammark 583 posts 1407 karma points
    Aug 21, 2011 @ 23:53
    Sebastian Dammark
    1

    Try using this extension:
    http://our.umbraco.org/wiki/reference/umbracolibrary/requestquerystring

    It should be pretty straight forward ... 

  • julius 107 posts 289 karma points
    Aug 24, 2011 @ 01:31
    julius
    0

    That was pretty simple. Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft