Copied to clipboard

Flag this post as spam?

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


  • Mo 34 posts 54 karma points
    Jun 11, 2012 @ 13:28
    Mo
    0

    XSLT for page redirection based up on the language

    I have one site with English and arabic in asp.net . I done it using umbraco . It working fine. But the problem is when i click on the image of arabic page it going to english decription page. I want to redirect it in to arabic of decription page. based up on the language selection it go it corresponding page.  Please help me to sort it out.  I know it is problem in my XSLT.

    In my template 

    I have one macro included

    <umbraco:Macro source="[#pageID]" Alias="ListCarouselBlocks" runat="server"></umbraco:Macro>

     

    xslt

    <xsl:variable name="source" select="/macro/source"/>

    <xsl:template match="/">

    <!-- The fun starts here -->
    <ul>
      
      <xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(umbracoNaviHide) != '1']">
        
        <li><href="{umbraco.library:NiceUrl(@id)}">
        <img height="156" width="220">
        <xsl:attribute name="src"><xsl:value-of select="carouselImage"/></xsl:attribute>
        </img>
        </a></li>
    </xsl:for-each>
    </ul>


      
      
    </xsl:template>

     

     

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 11, 2012 @ 14:07
    Jan Skovgaard
    0

    Hi Mo

    Are you sure that the xml you get back from the $source parameter is the one for the arabian site?

    If so...have you setup unique hostnames on each root node of the site? (Homepage nodes) and set the <useDomainPrefixes>true</useDomainPrefixes> in the /config/umbracoSettings.config.

    (I'd be surprised if this is the issue though, since the source should really be unique when using the nodepicker).

    Hope this helps.

    /Jan

  • mvkamalesh 7 posts 27 karma points
    Jun 12, 2012 @ 08:55
    mvkamalesh
    0

    Hi we have the similiar problem.

    I have one site with English and arabic in asp.net . I done it using umbraco . It working fine. But the problem is when i click on the image of arabic page it going to english decription page. I want to redirect it in to arabic of decription page. based up on the language selection it go it corresponding page.  Please help me to sort it out.  I know it is problem in my XSLT.

    In my template 

    I have one macro included

    <umbraco:Macro source="[#pageID]" Alias="ListCarouselBlocks" runat="server"></umbraco:Macro>

     #pageID should print the id for example the page is research its id is 1077 this page is in 2 nodes /en node and /ar node.

    xslt

    <xsl:variable name="source" select="/macro/source"/>

    <xsl:template match="/">

    <!-- The fun starts here -->

    <ul>

     <xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(umbracoNaviHide) != '1']">

        

        <li><a href="{umbraco.library:NiceUrl(@id)}">

        <img height="156" width="220">

        <xsl:attribute name="src"><xsl:value-of select="carouselImage"/></xsl:attribute>

        </img>

        </a></li>

    </xsl:for-each>

    </ul>

    </xsl:template>

  • mvkamalesh 7 posts 27 karma points
    Jun 12, 2012 @ 09:20
    mvkamalesh
    0

    hi the nodes already configured below..

    <useDomainPrefixes>true</useDomainPrefixes> in the /config/umbracoSettings.config.

  • Mo 34 posts 54 karma points
    Jun 12, 2012 @ 09:58
    Mo
    0

    I want to pass to nodeid contionally tht is 

    if the current page is english then 

    <umbraco:Macro source="1077" Alias="ListCarouselBlocks" runat="server"></umbraco:Macro>

    else if arabic page

    <umbraco:Macro source="1650" Alias="ListCarouselBlocks" runat="server"></umbraco:Macro>

    Please send me the script code to apply my template


     


Please Sign in or register to post replies

Write your reply to:

Draft