Need different title (h1) style for different pages

shax - August 8, 2008 - 16:49

Hello,

I'm having a problem with a web site I'm working on.

It has a left sidebar and content section, but I wanted the forum to take up the entire page (including the left sidebar space). I managed to do that through CSS only, but I'm left with one issue: The breadcrumb and "Forum" title are still only centered over the content section and not spread out over the whole page, like so:

http://protect.kafa.org.lb/forum

Is there a way I can modify the breadcrumb and the title for only the forum pages so that they're aligned correctly without changing ALL the breadcrumb and title positions?

thanks

My guess is you want to take

nevets - August 8, 2008 - 16:54

My guess is you want to take a different approach with you css. From what you said the left sidebar still exists on the forum page, it is just not visible and you have adjusted the content to "fill" that space. It is generally better to make sure the sidebar does not exist at all when empty and that the content section expand to take up the who width. Detail though depend on the theme in question.

Thanks for the prompt reply.

shax - August 8, 2008 - 16:59

Thanks for the prompt reply. I see what you mean... although I'm not quite sure how to go about that. I'm using a modified version of the abac theme.

What you'll want to do is

jimi089 - August 8, 2008 - 17:02

What you'll want to do is put a PHP if statement for the left column in your page.tpl.php file - that way it will only display the div for the left column if the left column exists.

I'm a total php novice,

shax - August 8, 2008 - 17:10

I'm a total php novice, wouldn't know how to code that. Can you give me a little more detail on that please?

thank you

In general terms you have

nevets - August 8, 2008 - 17:17

In general terms you have the left sidebar and the content area. In some cases the left sidebar is empty and in some cases not. The theme uses the id of 'center' for the content area. And it appears it always puts out the div that makes up the left sidebar (even if empty). What you want is to modify page.tpl.php something like this where it has

<div class="leftColumn">
<?php print $sidebar_left ?>
</div>

change to
                <?php if ( $sidebar_left ) : ?>
<div class="leftColumn">
<?php print $sidebar_left ?>
</div>
                <?php endif; ?>

This will get rid of the left sidebar completely when there is nothing in the left sidebar.

Now in style.css around line 125 change

.center {
PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: 8px; WIDTH: 455px; PADDING-TOP: 8px
}

to
.center {
PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: 8px; WIDTH: 700px; PADDING-TOP: 8px
}

(I changed the width from 455 to 700 to make the content area full width by default)
and AFTER it add
.sidebar-left .center {
  width: 455px;
}

which adjust the width of the content area downward if there is a left sidebar.
(I think the 700px is correct, it may need to be adjusted)

These adjustments are based on the theme as downloaded from drupal.org, your changes may require some adjustments.

That worked perfectly! Thank

shax - August 8, 2008 - 17:23

That worked perfectly! Thank you!

 
 

Drupal is a registered trademark of Dries Buytaert.