I couldn't find this issue covered in the forums. I am using Drupal 5.1. I have a modified version of Garland theme, with some new regions. All is working well except for one thing I can't figure out.
I added a region called 'fyi' with custom blocks assigned to it. This new region is displaying above (at the top of) the right sidebar. It works as long as there is a block assigned to right_sidebar. But if no block is assigned to right_sidebar in blocks admin then the region 'fyi' and its blocks doesn't display. I want the region 'fyi' to display with its assigned blocks on the right side of the page (in the sidebar) even if there is no block assigned to right_sidebar.
I tried modifying page.tpl, but it doesn't work. Any ideas on what am I doing wrong?
This works if there is a block assigned to right_sidebar:
...
<?php if ($sidebar_right): ?>
<div id="sidebar-right" class="sidebar">
<?php if (!$sidebar_left && $search_box): ?><div class="block block-theme"><?php print $search_box ?></div><?php endif; ?>
<?php print $fyi; // ADDED?>
<?php print $sidebar_right ?>
</div>
<?php endif; ?>
...
This is what I tried but it doesn't work as expected:
...
<?php if ($sidebar_right || $fyi): // MODIFIED to include $fyi ?>
<div id="sidebar-right" class="sidebar">
<?php if (!$sidebar_left && $search_box): ?><div class="block block-theme"><?php print $search_box ?></div><?php endif; ?>
<?php print $fyi; // ADDED?>
<?php print $sidebar_right ?>
</div>
<?php endif; ?>
...
Comments
Some thoughts, some things to try
I wonder if this because $sidebar_right and $fyi are strings. You might try
or even
or if neither of those works, there is always
Neither of these worked
Thanks Nevets, but none of these worked. I do appreciate you taking the time to help just the same. If you happen to think of something else to try or look at, I'm open. Thanks....
Mark
A real low-tech approach
A real low-tech approach would be to create an untitled block with nothing but
<br>in it and place it in the right side bar on the same pages you want the FYI to appear on.Nancy W.
now running 5 sites on Drupal so far
Drupal Cookbook (for New Drupallers)
Adding Hidden Site Design Notes
NancyDru
Thanks Nancy. This worked
Thanks Nancy. This worked and gives me the desired affect. However, I wish I could find a fix that didn't require generating bloated html. But, I'm happy it's working and is doing what I want. Thanks for the assistance.
Mark
I figured it out
I finally figured it out, so I figured I should share it just in case it helps someone else. The problem was, how to display a custom region in place of the right sidebar in the Garland theme. The custom region's name is 'fyi'.
First I modified the template like so;
Then I modified page.tpl like so;
Now my region displays in the right sidebar, just like the normal sidebar if it's not being used or it displays both, with fyi on top, just like I wanted.
Mark