Page 1 of 1

[solved] Expand Content block if no sub-navigation - Top sim

Posted: Tue May 29, 2012 10:18 pm
by dgbaker
Hi All!

I'm hoping someone can help guide me with what I'm trying to do. I am using the Top simple navigation + left subnavigation + 1 column for a new site. This works perfectly for us except one thing we need done.

We have removed the news block as we don't use it. But now we have a huge blank space now. So, what I am trying to achieve is the following;

If no sub-navigation menu to be displayed on the left, expand the content section to use full width. Else show sub-navigation and content as usual.

Hope that makes sense and is doable somehow.

Thanks
Dave

Re: Expand Content block if no sub-navigation - Top simple n

Posted: Wed May 30, 2012 5:01 pm
by Dr.CSS
You can do it but the default #content has CSS that keeps it 29% away from the left, so you would have to make changes to the CSS as well as the template...


{menu template='simple_navigation.tpl' start_level='2' collapse='1' assign='sidemenu'}
{if !empty($sidemenu)}
<div id="sidebar">
<div id="sidebara">

<div id="menu_vert">
<h2 class="accessibility">Sub Navigation</h2>
{$sidemenu}
<hr class="accessibility" />
</div>

</div>
</div>

<div class="back1">
{else}
<div class="back1wide">
{/if}

This will check the menu, if not (!) empty it will show the normal divs else it will give you a new div with class of back1wide which you will have to use CSS to style as you want...

Re: Expand Content block if no sub-navigation - Top simple n

Posted: Wed May 30, 2012 9:05 pm
by dgbaker
Thanks Dr. that worked great for me and did what I needed.

Cheers!