Copied to clipboard

Flag this post as spam?

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


  • Max 144 posts 166 karma points
    Dec 22, 2011 @ 08:36
    Max
    0

    get root node of multiple site for linking

    I have a mutiple site within one umbraco instance :

    the user want a site selection based on a drop down list similar to this link:

    http://www.nibble.be/?p=32

    but it does nto work in my case

    i have

    Content

    -International

     --Home

    -- About us

    -DanishSite

    --Forside

    --Kontack

     

     

    I want the dropdown list to be generated by xslt to link to the home pages of every multiple site..

    any code suggestions would be useful

     

     

     

     

  • Michael Friedrich 20 posts 97 karma points
    Dec 22, 2011 @ 10:05
    Michael Friedrich
    0

    This should work:

    <xsl:variable name="level" select="1"/>
    <xsl:template match="/">
    <select name="site">
    <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
      <option value="{umbraco.library:NiceUrl(@id)}">
        <xsl:value-of select="@nodeName"/>
      </option>
    </xsl:for-each>
    </select>
    </xsl:template>

    Perhaps you have to change the variable "level" to meet your content tree.

  • Max 144 posts 166 karma points
    Dec 23, 2011 @ 09:11
    Max
    0

    thansk was quite useful i used $currentPage/ancestor::root/*  instead

    thanks

    it did the trick i was looking for

     

  • Max 144 posts 166 karma points
    Jan 06, 2012 @ 10:09
    Max
    0

    there seems to be a problem however the 3 sites are from 3 different domain com, dk, bd

     

    i need it ti redirect to different domains of it not based on node name or id..

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 06, 2012 @ 10:26
    Dirk De Grave
    0

    you can't do that out of the box, i'd suggest to either:

    • add a property on your top level domain nodes and get that property for the option's value attribute, that property should hold http://domain.com blabla.
    • if you only have a single domain assigned to each of the top level nodes, you could get those using Domain api. (it's probably Domain.GetDomain(id), but not entirely sure on the syntax) 

    Hope this helps.

    Cheers,

    /Dirk

  • Max 144 posts 166 karma points
    Jan 06, 2012 @ 12:52
    Max
    0

    im putting the domain name within options:

    <option value='<xsl:value-of select="domainName"/>'>

    but this gives error any ideas how to resolve this issue..


  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jan 06, 2012 @ 13:22
    Chriztian Steinmeier
    0

    Hi Max,

    Inside an attribute you use curly-braces to grab a value - like this:

    <option value="{domainName}"><xsl:value-of select="@nodeName" /></option>

    /Chriztian

     

Please Sign in or register to post replies

Write your reply to:

Draft