Hi everyone, I'm really stuck on the proper way to achieve this so hope someone can help me out. I want sidebar_first region to always display even if it contains no content.
I want the div tags albeit empty to display on my page-front.tpl.php. Currently as no blocks display in sidebar_first on the front page the content div takes up the extra available space. Now I could just style page-front to take up this space so it looks like a blank sidebar space is there, however if someone adds a block to the sidebar_first in the future this wont work without me then changing the css. Hope that justified why I want to do this :-)
I noticed in page.tpl.php the sidebar_first region is printed using:
print $sidebar_first;
I noticed region-sidebar.tpl.php does not have any content blank logic so this must be done by some template.php magic.
This is where I stop swimming and start sinking fast..... I looked in zen template.php to see if I could do this overriding a function but got confused. Zen_blocks looks promising with a variable $show_blocks but I don't understand what's going on enough. I need to say if front page display both sidebars but think there is more too it than this.
Help or pointers would be very gratefully received..... I'm beat on this one :-)
Comments
Comment #1
shruti.sheth commentedHi,
Even if there is no content in sidebar left you can display it as follows
1. Replace your $sidebar_first code in your page.tpl.php as follows
2. Replace your $content code in page.tpl.php as follows
3. Add the following code in your .css file
Thanks,
Shruti
Comment #2
johnalbin