Developer forum

Forum » CMS - Standard features » Can I use a dwnavigation on a product template?

Can I use a dwnavigation on a product template?

Kim Søjborg Pedersen
Reply

Hi, can this be done and how?


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Hi Kim,

Yes, but the solution depends on which kind of template you are using...

Razor templates (.cshtml)

Use the RenderNavigation method in any template.

@RenderNavigation(new { id = "mynav"});

HTML templates (.html)

Navigations must be specified in the layout template. But, but, but...

You should be able to add the dwnavigation markup to your layout template (or master) and then use a snippet to move it inside your product template at render time.

Layout template <!--@SnippetStart(mysnippet)-->
<ul class="dwnavigation" id="mynav"></ul>
<!--@SnippetEnd(mysnippet)-->
Product template <!--@Snippet(mysnippet)-->

Does that solve your problem?

BR,
Morten

Votes for this answer: 1
 
Kim Søjborg Pedersen
Reply

Hi Morten,

Thanks, It's Razor, I missed the @RenderNavigation so I think I will look into how to use that, it sounds like the right choise.

Regards
Kim

 

You must be logged in to post in the forum