How to list the top level nodes when umbracoHideTopLevelNodeFromPath is set to true Options
jhoefnagels
Posted: Wednesday, May 14, 2008 3:23:29 PM
Rank: Newbie

Joined: 3/26/2008
Posts: 2
Location: Eindhoven
Hi, I would like to list the top level nodes of a multilingual site. There is a domain for each language so umbracoHideTopLevelNodeFromPath is set to true.

Now I would like to list the top level nodes to enable visitors to jump to each site using an xslt macro. Is there any known method to grab these nodes in xslt?

Thanks,

Jan
Dirk
Posted: Wednesday, May 14, 2008 3:31:26 PM

Rank: Fanatic

Joined: 9/27/2007
Posts: 403
Location: Belgium
I guess you're stuck here. In my opinion, it is impossible to list top level nodes that way and it's by design.

I wouldn't mind though to hardcode the links to the sites for the other languages.

Maybe have a look at the db. If you could find some info about the different domains you've set, you may as well query the db in a small user control and embed that user control in your macro.

But again, maybe someone else has already find a better solution to this.

Regards,
/Dirk


level 1 certified - umbraco blog at netaddicts.be
drobar
Posted: Wednesday, May 14, 2008 4:21:58 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,408
Location: KY, USA
umbracoHideTopLevelNodeFromPath does not mean you can't see the top level nodes... it just means that if you put content beneath a top-level node, that top-level node is NOT included in the url.

An example to clarify...

Suppose you have the following content structure:
Code:
CONTENT
  - EN
    - Page A
    - Page B
  - FR
    - Page C
    - Page D


If you hide the toplevel nodes, you'd get the following URLs:
en.aspx
page-a.aspx
page-b.aspx
fr.aspx
page-c.aspx
page-d.aspx

If you do NOT hide the toplevel nodes, you'd get these urls:
en.aspx
en/page-a.aspx
en/page-b.aspx
fr.aspx
fr/page-c.aspx
fr/page-d.aspx

Hope that helps clarify what that setting does.

There are good reasons to use it, and good reasons not to. It really depends on what you're trying to achieve, if you have host headers for each site, etc. etc.

cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
mortenbock
Posted: Wednesday, May 14, 2008 9:35:32 PM

Rank: Addict

Joined: 7/19/2006
Posts: 734
Location: Århus, Denmark
To get to the top nodes through xslt, you would need to go to the root.

Something like:

Code:

<ul>
  <xsl:for-each select="$currentPage/ancestor::root/node">
    <li>
       <a href="{umbraco.library:NiceUrl(@id)}">
         <xsl:value-of select="@nodeName" />
       </a>
    </li>
  </xsl:for-each>
</ul>


I'm looking for a new job

Morten Bock - Level 2 certified - MVP 2008/2009 - My danish blog with a few english posts

Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.