How can I make the left sidebar maintain a fixed width even if no block is being displayed? Thanks.

CommentFileSizeAuthor
#2 MG Design.jpg258.01 KBcmckay

Comments

Jeff Burnz’s picture

What are you trying to achieve by this, I ask because its trickier than it sounds - like most Drupal themes it layout is dynamic and relies on the presence of blocks in sidebars to trigger the right CSS classes to get printed in the theme, and thus it displays the correct layout.

Its certainly doable but requires some rethinking and re-jigging of how the CSS works - how are your skills with CSS and PHP?

cmckay’s picture

StatusFileSize
new258.01 KB

I am redesigning myappleguide.com and am displaying the 'dock' on the side and regular text navigation at the top. The final design will look like what you see in the attached image.

So far, this is what i have done:

In the page.tpl file I am calling the primary links at the top and the secondary links in the left sidebar (Technically both are the same, but I needed them to have different menu ids so I could style one set with icons and the other without. (I thought about using the primary links block, but I couldn't style each item separately.)

The problem is that with this implementation, the secondary menu does not show unless I have a block being displayed in the left sidebar.

Thanks for your help!

cmckay’s picture

I am pretty comfortable with CSS..PHP skills are poor :(

Jeff Burnz’s picture

Ok, I see, I would recommend going with a standard Drupal menu and using http://drupal.org/project/menu_attributes or override theme_menu_item(), I can show you how to do this if you need it - but it will add classes to all menus. Thats the advantage of menu attributes module, you can add unique classes to each individual menu item.

In other words, use a block and add classes to the menu items that you need to, I have found the menu_attributes module to be very useful.

If thats no good (you prefer not to use menu attributes) we'll move to plan b and write some new css for the layout.

cmckay’s picture

Thanks for recommending the module, Jeff. Though it should get everything that I want done, I would prefer to not use a module to handle such a core aspect of the site and would rather write some new CSS. How can I go about doing that? Thanks for your help again!

Jeff Burnz’s picture

How about this, I had this snippet lying around so I bashed out a quick tutorial, its for classes on menu items, as you see I am avoiding encouraging changing the layout because that will bite you later on, I'm sure, lets call that plan c now, if the tutorial is no good, then plan c ;)

http://adaptivethemes.com/how-to-add-unique-classes-to-drupal-menus

cmckay’s picture

Hmm..I will heed your warning and avoid plan c at all costs. I copied the code and added it at the end of my template file, renamed it genesis_SL_menu_item_link. The site comes up bank :/ ...am I missing a step? I haven't overridden anything else in my template file so everything else is commented out as default.

Jeff Burnz’s picture

did you remove the php tags? otherwise clear the theme registry (you do this by making sure its the first thing to click, so be on the performance settings page already), shouldn't be blank, thats a php error most likely, double check everything

cmckay’s picture

Fantastic! It worked like a charm :D. Jeff, thanks so much for the help!! I'll send you a link next week when the theme is up and running.

Jeff Burnz’s picture

Status: Active » Fixed

Yes, please do, I will add it to the project page as an example site using Genesis, I like to rotate them and show different sites.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.