Check if Navigation is null

Topics: Writing themes
Jun 12, 2011 at 5:42 PM

If i add in my theme the check

if Model.Navigation != null

then the navigation get's displayed event if there are no menu items.

I use the standard navigation module.


What is the best way to check that?

Jun 12, 2011 at 8:26 PM

I think it's because the menu filter is inserting the menu shape whether it contains anything or not. That could be seen as a bug; maybe raise a workitem. The only way around it would be to disable the menu filter.

Although; can you post the entire code from your view? That line is missing @ as well as brackets.