How can I hide a div if menu is empty
Re: How can I hide a div if menu is empty
I would attempt to resolve this by creating my own template based on minimal_menu and putting the div tags within the template, only showing them if there are menu items to show. Worth a try?
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation
CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
https://docs.cmsmadesimple.org/troubles ... nformation
CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
Re: How can I hide a div if menu is empty
Another options is to use the smarty {capture} tag.
It is said to be less efficient though.
Make sure the Navigator template returns nothing (not even some spaces) if there are no menu items to show.
It is said to be less efficient though.
Make sure the Navigator template returns nothing (not even some spaces) if there are no menu items to show.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: How can I hide a div if menu is empty
Though paul's answer is technically the best... this will also work (and is better than capture, which is slow).
{Navigator loadprops='0' template='minimal_menu' start_level="2" assign='tmp'}
{if !empty($tmp)}<div class="wrap">{$tmp}</div>{/if}
{Navigator loadprops='0' template='minimal_menu' start_level="2" assign='tmp'}
{if !empty($tmp)}<div class="wrap">{$tmp}</div>{/if}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: How can I hide a div if menu is empty
after assigning you get access to the Navigator parameters in your Core::Page template. So you can also do something like:
{Navigator loadprops='0' template='minimal_menu' start_level="2" assign='tmp'}
{if isset($nodes)}<div class="wrap">{$tmp}</div>{/if}
{Navigator loadprops='0' template='minimal_menu' start_level="2" assign='tmp'}
{if isset($nodes)}<div class="wrap">{$tmp}</div>{/if}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -