Developer forum

Forum » Templates » If/Else on menu tag

If/Else on menu tag


Reply
Hi,

I'd like to use the if defined tags to check wether to render my menu container or not.

I've tried with this code (spaces added to avoid html comment):
< !--@If Defined(subMenu)-- >
< !--@subMenu-- >
< !--@EndIf(subMenu)-- >
< !--@If Not Defined(subMenu)-- >
 No menu
< !--@EndIf(subMenu)-- >


But only "No menu" is rendered.

Is it not possible to check if a menu should be rendered?

//Martin 

Replies

 
Nicolai Høeg Pedersen
Reply
Well - this should work...

What happens if you put the < !--@subMenu-- > outside the if tags?
 
Reply
If i put my menu tag outside the If/else, it's rendered when it has something to show.
No HTML is rendered when there are no links in the menu.
 
Reply
Hi Guys

Take a look at this forum post:
http://engage.dynamicweb-cms.com/Forum-5.aspx?action=ShowThread&ThreadID=1322

It does not solve the problem, but it tells you why.

// Dammark

 

You must be logged in to post in the forum