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

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
dgbaker
New Member
New Member
Posts: 4
Joined: Tue May 29, 2012 10:12 pm

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

Post 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
Last edited by dgbaker on Wed May 30, 2012 9:06 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

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

Post 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...
dgbaker
New Member
New Member
Posts: 4
Joined: Tue May 29, 2012 10:12 pm

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

Post by dgbaker »

Thanks Dr. that worked great for me and did what I needed.

Cheers!
Post Reply

Return to “Layout and Design (CSS & HTML)”