Developer forum

Forum » Templates » If Defined on navigation

If Defined on navigation

Regin Madsen
Reply
Hi,

In layout you can do a If defined on content placeholders. Im quite sure I we seen that done on navigations as well - is that possible, if yes how?

/Regin Madsen 

Replies

 
Søren Mejlby
Reply
 
Regin Madsen
Reply
 Yep, thought so - but doesn't work on the solution Im working on :-(

Il go on to support....


 
Nicolai Høeg Pedersen
Reply
You might want to check that your XSLT does not return anything at all when no items are present.

Start your xsl:template with a test like this:
<xsl:if test="count(//Page) > 0">


 
Regin Madsen
Reply
Nicolai -> yes that could be a solution, and when you write it that way I guess its the same as "If defined" on navigation doesnt work?

/Regin

 
Nicolai Høeg Pedersen
Reply
If defined on navigation works fine... We use it i.e. at dynamicweb.dk
 
Regin Madsen
Reply
Is it because the page must not have subpages - not even if theyre hidden in the menu? I have copy/pasted Sørens code more or less as it seems right, and changed the ID
<!--@If Defined(DwNavigation(leftNavigation))-->
<ul >
    <li class="parent"><a href="#"><!--@DwPageName_1--></a>

 <ul title="Menu left" class="dwnavigation sidebar-menu" id="leftNavigation" settings="startlevel:2;endlevel:4;template:Leftmenu.xslt;expandmode:path;">
      </ul>


       </li>
</ul>
<!--@EndIf(DwNavigation(leftNavigation))-->




 
Nicolai Høeg Pedersen
Reply
It looks right... The devil is in the detail.

Post a URL or mail me - I'll have a look.

 
Regin Madsen
Reply
 Hi Nicolai,

I did post you a mail a few days ago, have you had the time to look at it...

 

You must be logged in to post in the forum