Greetings - I am using Drupal 5, and this is what I currently have at the end of my style.css:
/* Page Width Settings */
#main .breadcrumb {
width: 960px;
}
#main .inner {
width: 960px;
}
Which works quite well to force the width of the content area on all of my pages/nodes. However, what I would like to do is have a different width on just the front (I have an extra block on the left side, requiring the main content area to be less). I have already thought about creating a specific node/page and duplicating the front page, and then specifying that specific node/page as the front page, and trying to theme that specific page/node, but that doesn't seem to be working well (at least, I can't figure it out). And there seems to be no way (that I can locate) to directly alter only the front page directly.
I have spent hours googling, and searching through the forums, and cannot find any good documentation on how to do this...
Any help is GREATLY appreciated.
Thank You.
Comments
.
A solution may be adding a new region for your theme on the left. That region will appear just if there is blocks for it.
So, in your block configuration make your block appear just for your front page and add some in-tag style code in that case( if that region is not empty ) for .breadcrumb and .inner.
I suppposed breaddcrumb and inner are rendered by your page.tpl.php ( or mytheme_page() if you don't like phptemplate engine ) and not by node.tpl.php( mytheme_node() ).
This solution will need some php skills. If you don't know php, provide more information to see if i can help you with a snippet
Perhaps I wasn't clear as to
Perhaps I wasn't clear as to exactly what I wanted.
What I want is for breadcrumb and inner, when on the front page ONLY, to be a smaller width. (Or similar when dealing with a different node that actually has a nid).
I hope that is clearer... I'm 99% sure this should be able to be done with CSS strictly, but I'm not sure....
Thanks!
...
The problem is this is a less-than-optimal approach - setting the width on a nested element to force the width of the containing element is asking for trouble.
DIV's, by default, will expand to take up 100% of the width of their containing element, thus its normal to use a wrapper and set the width on that (grid methodologies not-with-standing of course).
You can then safely use collapsible regions, such as a sidebar, within the wrapper and never have to think about the total width. Themes such as Pixture Reloaded, Zen and Genesis all use wrappers to set the width and worth studying for tips and tricks.
If you really must persist with your method the you can easily use $body_classes or something like this set directly on the element in question:
<div id="breadcrumb" class="<?php print $is_front ? 'front' : 'not-front' ; ?>">Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Okay, so what CSS code would
Okay, so what CSS code would I use to give the wrapper a fixed width? (The wrapper that contains all of the "content" elements). And then again, the question still lies, how do I go about specifying a fixed width on one node/page, and a different fixed width on another? (such as the front).
...
Ok, you could do it like this, I will post some html and the css will follow. The html is for example:
Thats one very simple way of doing this. Take a look at Zen for Drupal 5, see how it prints classes in the body tag - that is a more usefull approach. You could replicate that in your theme and use the same idea.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.