Aligning a block (search module) to the right side of the page

wanmatt - March 28, 2008 - 05:36

I can't seem to figure out how to align the block to the right side of the main content body section.

Am I suppose to do it from the 'configure' link in the block management? or do I have to look into the code somewhere? I tried to look into the modules code but I can't seem to find anything that resembles alignment.

Have a look at your pages

wishstik - March 28, 2008 - 07:31

Have a look at your pages source code and then look for you block. You'll see something like 'block-node-4' and you can style this with CSS (float:right;). This is more of a theme related topic, I just had a look in Theme Development where they talk about exactly this - http://drupal.org/node/237814

This is an issue with the

nicholasbarcomb - March 28, 2008 - 07:52

This is an issue with the page.tpl.php in your theme's directory. Look in this file's code and you'll see something like:

<?php print $search_box ?>

or
<?php if ($search_box): ?><div class="block block-theme"><?php print $search_box ?></div><?php endif; ?>

The first example was from Bluemarine and it was right under the primary links in the menu div tag.
The second was from Fourseasons and it was in the left sidebar div tags.

So now that you've found it, to put it in the right sidebar, move the code to be within the right sidebar's div tags, something like:

    <?php if ($right): ?>
      <div id="sidebar-right" class="sidebar">
        <?php if ($search_box): ?><div class="block block-theme"><?php print $search_box ?></div><?php endif; ?>
        <?php print $right ?>

And if you don't see it, make it. $search_box calls the core search module.

still no go

wanmatt - March 29, 2008 - 08:45

Been messing with the theme tmp files and style sheets.. still can't figure out how to make the search module line to the right!

mattwan.net

thanks

 
 

Drupal is a registered trademark of Dries Buytaert.