I’ve already asked this, but I don’t think I was specific enough!
I’m looking for a very simple way for a div to be hidden when there isn’t any information in it. – It needs to be simple for the client so they don’t have to worry about it.
The Div has information put into it with joomla in certain categories.
For example on my main template I might have a div below my nav on the left, I can choose which pages it displays modules in, but when it’s not in-use it still displays it’s borders.
I also don’t want to use many different templates for the site, just have the ability to use many module positions, but when they’re not in use, they’re hidden.
Have a look, under my nav on the left.
If it helps, here is the code i’d be trying to hide if joomla isn’t outputting any data on that page:
<div id="lnav2">
<jdoc:include type="modules" name="left2" />
</div>
Thanks in advance
In Joomla! templates you can use
countModulesto determine if a module is infact set for the position. So your code could be wrapped like this:That way the
<div id="lnav2">is only rendered if there is an active module for the position.