Copied to clipboard

Flag this post as spam?

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


  • Rik Helsen 670 posts 873 karma points
    Oct 28, 2009 @ 10:59
    Rik Helsen
    0

    Creating "virtual items" in navigation that target a certain page with url rewriting

    We have a number of usercontrols that display events using querystring parameters for productions and productiontypes

    Now i was wondering how you would add "virtual" links to the navigation (so navigationfromsource would return them).

    So i'd want to add links like these to the navigation structure:

    website.com/nl/events/dance
    website.com/nl/events/architecture
    website.com/nl/events/opera

    that are then rewritten to

    website.com/nl/dyn/productionsearch.aspx?prod_type=1
    website.com/nl/dyn/productionsearch.aspx?prod_type=2
    website.com/nl/dyn/productionsearch.aspx?prod_type=...

     

    What approaches do you suggest?

    creating a node-type "virtuallink" that has a nodename and a link associated with it?

  • Rik Helsen 670 posts 873 karma points
    Oct 28, 2009 @ 13:04
    Rik Helsen
    0

    I've been able to do this by creating a new documentype "VirtualPage" that has a nodename and a hyperlink.

    Then in the navigationfromsource.xslt I change the link href incase of one doctype to the enteredvalue:

     <xsl:for-each select="umbraco.library:GetXmlNodeById($sourceNl)/node [string(data [@alias='umbracoNaviHide']) != '1']">
    <li>
    <xsl:if test="@nodeType = '1300'">

    <a href="{./data [@alias = 'VirtualLink']}">
    <xsl:value-of select="@nodeName"/>
    </a>
    </xsl:if>
    <xsl:if test="@nodeType != '1300'">
    <a href="{umbraco.library:NiceUrl(@id)}">
    <xsl:value-of select="@nodeName"/>
    </a>
    </xsl:if>

    </li>
    </xsl:for-each>
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies