In one of the video's is shown how to create a multi-langual website. I noticed that on level 0 multiple pages where created for each language. I've also added some pages on level 0 and would like to create a navigation for each languages. The names are "NL", "UK" and "FR". These are also the names I would like to use in the naviagtion.
I've tried several solutions I found on this forum but none of them seem to work. My Macro currently looks like this...
Please notice that the example Kim has provided is using the new XML schema. So if you're using the old schema, which it seems like from the code you posted above you will need to modify the syntax a bit. Concept is the same.
Maybe you can talk Kim into showing the same example based on the old syntax? ;-)
Your code should work Tim. Only the difference I found in your code is instead of using currentPage, you have used currenPage along with root variable. Your code should be like this
Level 0 navigation
Hi,
In one of the video's is shown how to create a multi-langual website. I noticed that on level 0 multiple pages where created for each language. I've also added some pages on level 0 and would like to create a navigation for each languages. The names are "NL", "UK" and "FR". These are also the names I would like to use in the naviagtion.
I've tried several solutions I found on this forum but none of them seem to work. My Macro currently looks like this...
<xsl:for-each select="$currentPage/../node">
<td class="MainTopTableLang"><xsl:value-of select="@nodeName"/></td>
<td><img src="./Images/lang_sepa.gif" class="MainTopImgLang"/></td>
</xsl:for-each>
Does anyone have a solution. Thanks
Tim
Hi Tim
You want to create a navigation for all the top level nodes?
If that's the case try this:
/Kim Andersen
Hi Tim
Please notice that the example Kim has provided is using the new XML schema. So if you're using the old schema, which it seems like from the code you posted above you will need to modify the syntax a bit. Concept is the same.
Maybe you can talk Kim into showing the same example based on the old syntax? ;-)
/Jan
Yeah, okay if you are using the legacy XML schema you should do something like this instead:
<xsl:variable name="root" select="$currentPage/ancestor-or-self::root" />
<xsl:for-each select="$root/node">
...do your stuff here...
</xsl:for-each>
/Kim A
Hi Kim and Jan,
I've tried both your solutions but no luck. Now, A error is thrown "The variable of parameter currentPage is not defined or out of scope"
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:variable name="root" select="$currenPage/ancestor-or-self::root" />
<xsl:for-each select="$root/*[@isDoc]">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The same error is thrown when trying to use the second code.
Any help would be great
Kind regards
Tim
If you copied the code from the post(s) above, you will probably have a spelling mistake - $currenPage should be $currentPage ... note the "t" ;-)
Your code should work Tim. Only the difference I found in your code is instead of using currentPage, you have used currenPage along with root variable. Your code should be like this
Thanks
Pnima
Hi everyone,
It was indeed a spelling mistake...
Thanks for all your help.
Kind regards
Tim
Ahh sorry for the confusion Tim. That was a typo of course - I've fixed it in my snippets above now :) But perfect that you got it working.
/Kim Andersen
Wow, I really should have caught that one when I replied - but good to see that others are not blind :-)
/Jan
is working on a reply...