Copied to clipboard

Flag this post as spam?

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


  • Pieter 1 post 21 karma points
    Jan 19, 2010 @ 15:21
    Pieter
    0

    Problems with CurrentPage param with umbracoInternalRedirectId Alias

    Hi,

    I'm having a problem with my site and hoping you have ideas for the sollution. In the current situation I have a site with a data folder contaning all kind of contentItems. I need to use the contentItems on multiplesites in the same instance of Umbraco.

    I use the umbracoInternalRedirectId alias to load the data on multiple places/sites. Works great! Now i'm trying to render the navigation with a simple XSLT. The only problem is that the 'currentPage' param is the InternalRedirectedItem so the navigation is build based on the datafolder not the actual website.

    Is there param or way to get real currentPage, not the linked currentPage?

    Thanks in advance!

  • dandrayne 1138 posts 2262 karma points
    Jan 19, 2010 @ 16:07
    dandrayne
    0

    I had a similar problem, and had to do something a bit horrible for navigation

    ...here goes, forgive me!

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:CWS.Twitter="urn:CWS.Twitter"
    exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets CWS.Twitter ">


    <xsl:output method="xml" omit-xml-declaration="yes"/>



    <xsl:variable name="website" select="umbraco.library:Request('HTTP_HOST')" />

    <xsl:variable name="homePageNode">
    <xsl:choose>
    <xsl:when test="string($website) = 'subdomain1.site.com'">
    <xsl:text>1208</xsl:text>
    </xsl:when>
    <xsl:when test="string($website) = 'subdomain2.site.com'">
    <xsl:text>1266</xsl:text>
    </xsl:when>
    <xsl:when test="string($website) = 'subdomain3.site.com'">
    <xsl:text>1281</xsl:text>
    </xsl:when>
    <xsl:when test="contains(string($website),'uniquedomain1')">
    <xsl:text>1208</xsl:text>
    </xsl:when>
    <xsl:when test="contains(string($website),'uniquedomain2')">
    <xsl:text>1266</xsl:text>
    </xsl:when>
    <xsl:when test="contains(string($website),'uniquedomain3')">
    <xsl:text>1281</xsl:text>
    </xsl:when>
    <xsl:otherwise>
    <xsl:text>1208</xsl:text>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>

    <xsl:variable name="homepageXML" select="umbraco.library:GetXmlNodeById($homePageNode)" />

    </xsl:stylesheet>

    I then include this in any other xslt file that need to know which site they are currently being used in: It's essentially hardcoding the homepage nodes for various sites.

    Urgh.  I'd love to hear a better way to do this

    Dan

Please Sign in or register to post replies

Write your reply to:

Draft