Developer forum

Forum » Templates » Global:Area.ID in xslt

Global:Area.ID in xslt

Martin Kure
Reply

Hi,

I'm making a breadcrumb in my xslt - so far so good.

Within the xslt a have a list-tag, which should alway link to the front page of the current language layer. So far I've tried this, but without any luck.

"<li><a href="Default.aspx?ID=<!--@Global:Area.ID-->">Forside </a></li>" 

Is there a way to link to the global area Id from the xslt?

BR
Martin

 

 

 

 

 

 


 

 

 


Replies

 
Mikkel Ricky
Reply
This post has been marked as an answer

You cannot use <!--@…--> in xslt – you have to use xpath to get values from the navigation xml.

Try something like this

<a>
    <xsl:attribute name="href">Default.aspx?Id=<xsl:value-of select="/NavigationTree/Settings/Pageview/@AreaFirstPageID"/></xsl:attribute>
    <xsl:value-of select="/NavigationTree/Settings/GlobalTags/Global.Area.Name"/>
</a>

Best regards,
Mikkel

 

 

Votes for this answer: 1
 
Martin Kure
Reply

Thank you very much, Ricky. That did the trick.

 
Sebastian Dammark
Reply

A bit late but a bit nicer :)

<a href="{concat('Default.aspx?Id=', /NavigationTree/Settings/Pageview/@AreaFirstPageID)}">
<xsl:value-of select="/NavigationTree/Settings/GlobalTags/Global.Area.Name" />
</a>

 

 

You must be logged in to post in the forum