Developer forum

Forum » Templates » get menu level from XSLT

get menu level from XSLT


Reply

Hi

 

Is there a way to get the current menu level?

 

/Allan


Replies

 
Reply

Hi Allan

 

When you're on a Page node you should have an attribute called 'AbsoluteLevel'.

 

This attribute should contain the lavel you're looking for.

 

 // Dammark

 
Reply
Dammark wrote:

Hi Allan

 

When you're on a Page node you should have an attribute called 'AbsoluteLevel'.

 

This attribute should contain the lavel you're looking for.

 

 // Dammark


 

Hi Again

 

I cant seen to get any value from that.

 

I have triede to get it from<xsl:template match="/Template"> with [<xsl:value-of select="AbsoluteLevel" disable-output-escaping="yes"/>]

 

Is this right?

 

/Allan

 

 

 
Reply

Uhh ... if you're in the 'Template' node I would use an xPath looking something like this: 'Page/@AbsoluteLevel'

 

Remember the @ since it's an attribute.

 

// Dammark

 
Reply
Dammark wrote:

Uhh ... if you're in the 'Template' node I would use an xPath looking something like this: 'Page/@AbsoluteLevel'

 

Remember the @ since it's an attribute.

 

// Dammark


 

Aghh, I just can't seem to get any value out :(

 

Is there a way to get the raw XML posted, then I can make som local test in the XSLT.

 

/Allan

 
Reply

Hi Allan

 

Yeah, take a look at this article: http://developer.dynamicweb.dk/Weblog-16918.aspx?action=ShowArticle&ArticleID=162

 

Otherwise you can add '&savexml=yes' to the URL and it will generate an XML filen in the /Template/Navigation folder.

 

Or you can do like this in your XSLT file:

<textarea>

   <xsl:copy-of select="/" />

<textarea>

 

This will give you an output directly on your website.

 

// Sebastian

 

 
Reply
Dammark wrote:

Hi Allan

 

Yeah, take a look at this article: http://developer.dynamicweb.dk/Weblog-16918.aspx?action=ShowArticle&ArticleID=162

 

Otherwise you can add '&savexml=yes' to the URL and it will generate an XML filen in the /Template/Navigation folder.

 

Or you can do like this in your XSLT file:

<textarea>

   <xsl:copy-of select="/" />

<textarea>

 

This will give you an output directly on your website.

 

// Sebastian

 


 

Im getting closer, but Is there a max i menues? I have to use a menu to retrive the wainted node, besause the Page template only contains the template node.

 

I already has 3 menues, and when I add anohter it's emty!

 

/Allan

 
Reply

Hi Allan

 

No, there is not a max in menues.

 

// Dammark

 

You must be logged in to post in the forum