Developer forum

Forum » Templates » XSLT menu inside a Paragraph template

XSLT menu inside a Paragraph template


Reply
Hello all,

I hope some of you are able to help me out here.

Is it possible to get a menu inside a paragraph template? I am using XSLT. I have no problems doing so this in the page template, but right now I need it to be inside a Paragraph template! How do I make the paragraph template drag out menu information? Or can I somehow go back in the XML-order? Hoping to hear from you very soon.

Best regards
Jannik Rasmussen

Replies

 
Nicolai Høeg Pedersen
Reply
It is not possible to get hold of navigation inside a paragraph template (not yet anyway - comes with 7.1 and the new layout implementation method)

What you can do is using Sitemap2 - it uses the navigation system and is a module that can be attached in a paragraph.

Then you can add the sitemap to a paragraph that you call from you paragraph template using the global tag:

<!--@Global:Paragraph.Content([ID])-->

http://templates.dynamicweb.dk/TemplateTags/Dynamicweb-template-tags/General-tags/Global-template-tags.aspx
 
Reply

Okay,

Thank you for your reply, I'll look at the sitemap solution. :)

 
Reply
If you just need to write out the menu as-is, the menu tag is parsed after the XSLT executes. 

Therefore you can use :

<xsl:text disable-output-escaping="yes"><![CDATA[<!--@MenuTag-->]]></xsl:text>

 
Anders Ebdrup
Reply

Think I got it and for other looking for a solution:

 

XmlDocument doc = new Dynamicweb.Frontend.XmlNavigation(base.Pageview).XML(base.Pageview.Page.ID, 1, 5,
                                                                          Dynamicweb.Frontend.XmlNavigation.Expand.All, base.Pageview.AreaID);

 
Nicolai Høeg Pedersen
Reply

Hi Again

 

With 8.2.02 released yesterday I've made a feature so you can use a new template tag that looks like this:

<!-- @Navigation.Render(settings)--> where settings are the same as you would use in your layout files, i.e.

<!-- @Navigation.Render(startlevel:1;endlevel:3;expandmode:all)-->

 

This tag can be used in any template throughout the system.

 

BR Nicolai

 
Rene Poulsen
Reply

Hi, 

Do any of you guys have problems with the "inpath" class not being set on the first item in the menu? E.g. if I have the following structure

  • Page 1
    • Subpage 1.1
    • Subpage 1.2
  • Page 2
    • Subpage 2.1
    • Subpage 2.2
  • Page 3

If i click on Page 1, Subpage 1.1 or Subpage 2.1, the "inpath" class is not added, but if I click on Page 2, Page 3, Subpage 1.2 or Subpage 2.2, the inpath class is added like it's supposed to.

 

 
Nicolai Høeg Pedersen
Reply

Can we see your XML (add savexml=true in frontend and see the folder where the XSLT is located) and XSLT?

 

BR Nicolai

 

You must be logged in to post in the forum