I’m just testing out the new drupal 5.0, I like the garland theme, but the sidebars are too wide for my liking, is there a way to change the width, narrowing them down a bit?

When I used bluemarine all I did was change the width: 14.5 in the .css below:


#sidebar-left, #sidebar-right {

}

But don’t know how to narrow down the width in Garland, anyone know?

Comments

glendac’s picture

I haven't tried this but as you have done with bluemarine, look in Garland's style.css file and adjust the sidebar width. Garland has fluid width specifications that you can adjust in several places in its stylesheet as shown below:

/* So we move the #center container over the sidebars to compensate */
body.sidebar-left #center {
  margin-left: -210px;
}
body.sidebar-right #center {
  margin-right: -210px;
}
body.sidebars #center {
  margin: 0 -210px;
}

/* And add blanks left and right for the sidebars to fill */
body.sidebar-left #squeeze {
  margin-left: 210px;
}
body.sidebar-right #squeeze {
  margin-right: 210px;
}
body.sidebars #squeeze {
  margin: 0 210px;
}

/* We ensure the sidebars are still clickable using z-index */
#wrapper #container .sidebar {
  margin: 60px 0 5em;
  width: 210px;
  float: left;
  z-index: 2;
  position: relative;
}
jason342’s picture

I don't understand what you mean. For bluemarine it was obvious what to do. This is not the case with garland.

I tried width: xx.x; in the above code but nothing changes visually.

larryk12’s picture

Hello,

I've -- like others, have spent HOURS trying to get garland to display good in both IE and Firefox.
IE is displaying perfectly -- great theme!

now, in firefox -- the side bars are HUGE.. the center is small.

Its like a puzzle on what to change where and how much...
my brain is telling me = too many combinations (or learn more css)

*smile*

any help -- exactly what to edit?

THANKS

FYI. does your drupal garland display the same in firefox and IE?

meignorant’s picture

I've spent 16 hours trying to change Garland sidebar width and no luck.
Please help, me and 30,000 people that come every week to argue about "will it fly or not" really need a better Garland layout.

P.S. Also we need to set up a secure registration / login that would be secure againt robots, brut force, etc. Any suggestions before I waste another 16 hours of my life?

jason342’s picture

This is becoming an impossible task. I can’t figure it out. The sidebars are too wide making the content too narrow especially if you have left and right sidebars enabled.

I liked the garland theme, but after two days working on it trying it seems like a very inflexible theme.

Someone please find out how to change the width of the sidebars!

Thor-X’s picture

In fact it's a very nice theme with a lot of flexibility but requiring slightly above average css knowledge and remembering instructions.

The theme is using margins to control the layout depending on which sidebars are present on any given page. F.ex. if there are no sidebars the content uses 100% of the width and if the left sidebar is used the content is pushed 210px to the right to accomodate for the left sidebar etc.

In the style.css for Garland you'll find the following code where you can change the width of the sidebar but don't change the z-index or your links will become unclickable.

#wrapper #container .sidebar {
  margin: 60px 0 5em;
  width: 210px;
  float: left;
  z-index: 2;
  position: relative;
}

Further you'll find the following css-declarations in the stylesheet that will need changing of the margin to match the width you set above.

/* So we move the #center container over the sidebars to compensate */
body.sidebar-left #center {
  margin-left: -210px;
}
body.sidebar-right #center {
  margin-right: -210px;
}
body.sidebars #center {
  margin: 0 -210px;
}

/* And add blanks left and right for the sidebars to fill */
body.sidebar-left #squeeze {
  margin-left: 210px;
}
body.sidebar-right #squeeze {
  margin-right: 210px;
}
body.sidebars #squeeze {
  margin: 0 210px;
}

body.sidebar-left  #footer {
  margin-left: -210px;
}

body.sidebar-right #footer {
  margin-right: -210px;
}

body.sidebars #footer {
  margin: 0 -210px;
}

Lastly remembering instructions which I ironically don't remember where I read them but if you've changed the default color of the Garland theme it will create a new css-file which it places in the [your-path-to-drupal]/files/color folder. So you need to go to administer->site building->themes->Garland and then just press the "save configuration" button and you should be all set. Now don't try using any short-cuts like changing the css-file in the files/color folder directly since it will be over-written the next time you change anything in the Garland folder.

Hope this helps.

Pontus

lazycat’s picture

I think you're right. It does have something to do with that "save configuration" thing. Because when you just change style.css and upload it into themes/Garland folder, nothing happens at all.
Hmm.. I'll play with it today and tell you how it goes.

glendac’s picture

Yeah, I guess Pontus is right. I looked at the css file in the files/color/garland-colorscheme-you-chose/ and it's pretty much a mirror of the stylesheet in the main Garland directory except for the color. I guess one needs to match the changes between these two files so saving configuration might not be enough. But I decided not to mess up with the thing further. I thought I knew some CSS but this exercise in modifying Garland's sidebar widths stumped me too. Not that I really want to modify the widths, I'm quite happy with how the widths adjust to content (see my 5.2 install at http://softtester.org/test/drupal5). Still, this exercise reminds me that there is always some really complex thing underneath anything that looks easy and flexible.

khanvanna’s picture

By setting Input Format for each posts, the right sidebar pops to left bottom of the frontpage. Why?? If disabling the above tags, it works fine. In the posts, there're <div>, <img>, <object>,.. tags

Thor-X’s picture

Setting input format in itself shouldn't brake the layout. Most likely the img, object or something else is to wide to fit but I'm confused as to how disabling the css helps in correcting things. Can you post a link to your site or maybe the code you're inserting and relevant css-styling?

Pontus

Chill35’s picture

Thor-X, please try to change these values yourself. You'll see how tricky it really is.
Changing the width from 210 to 200 is possible, but not one pixel narrower than this.
I am not saying there's anying wrong with Garland :)
I would like to find the solution for this chinese puzzle.

Best regards,

Caroline

mjohnq3’s picture

I've successfully changed the width to 155 and it looks fine. Try changing the min-width value of 'body-sidebars' and 'body-sidebar-left', 'body-sidebar-right' to a smaller value; 900 and 700 respectively worked well for me.

Chill35’s picture

Will look into this now.

Great info.

Caroline

Chill35’s picture

Bingo, I had to change the min-width of 'body-sidebars', 'body-sidebar-left' and 'body-sidebar-right'.

Thank you very much!

I had forgotten to report on my success.

Caroline

mjohnq3’s picture

I'm glad you were able to get it to work. Garland is a very nice theme but the sidebars were just too wide with the default CSS settings.

fsadr’s picture

Hi,

How come no one talks about the stretch of the height of the sidebar?
On my page, the left sidebar's height is only covering half of my page height.
Any comments?

Thanks

benc’s picture

A good introduction to CSS technique for table-less layouts:

A List Apart: Holy Grail

"Drupal and the Power of Categories (Taxonomy)"
http://digitalsolutions.ph/couchkamotereviews/power_drupal_categories

Thor-X’s picture

You shouldn't worry yourself with the automatically created css-file in the [your-path-to-drupal]/files/color folder. Just know that it's there (if you've changed the default theme in any way) and how that affects (or not affects in this case ) changes done to style.css.

Whenever you visit administer->site building->themes->Garland your current color theme should be shown.

What happens when you press the "save configuration" button is that the style.css (that you've now modified) is used to create a new custom css-file using the color values found on the Garland settings page.

Cheers

Pontus

russgri’s picture

is a piece of cake.
Search replace for the default width....210 replace with...200 ...
Save
Then go to Adminster/Themes/Garland
Save Configuration.

The Theme Developers should have set the page css so that each column would have different size.
Then we could change both to our needs.
This may have been accomplished but at first blush...it seems they are coupled.
---------------
Russell Griechen

Chill35’s picture

Changing to 200 or even 190 is feasible, but no narrower than that, with a search and replace. Look above.
You need to change min-width of a couple of things if you want narrower than 190 px.

Caroline

kdfrawg’s picture

It seems to me that the original intent of CSS files was to give oneself a single place in which to make changes in page presentation with some level of granularity. A requirement that one change setting after setting like this, in ways that are inherently correct but not very intuitive, seems to defeat part of the purpose of CSS files. Or is it just me?

(I would not be surprised to find that it is just me)

Michael

"I was going to buy a copy of The Power of Positive Thinking, and then I thought: What the hell good would that do?"
-- Ronnie Shakes

sepeck’s picture

The intent of CSS was to simplify managing a look at feel to your web pages/site. The reality of CSS is differing standards and implementations of browser support. Also CSS design, engineering and implementation has evolved over the years to utilize differing techniques to accomplish stuff. That said, you still only need to change your site in the CSS.

Garland is an advanced theme that utilizes negative margins among other techniques to achieve balance in it's design. I have found it easier to design my stuff from scratch because then it's all up to me to get my theme working. I don't have to learn CSS and someone else's use and implementation of CSS if I attempt to modify it.

Blue Marine is still an excellent base theme to start with customizing to your needs. Zen is a relative new contribution that was designed to help make it easier for people to theme their own stuff as well.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

kdfrawg’s picture

< nod, nod > That makes sense. I like the concept of the css, but tend to use it diffently than people who are truly css adherents. I put styles in the css and do page design someplace else. It is just a different way of looking at things, I suppose. I am still pondering the use of Drupal and very much appreciate your thoughts on this matter. Personally, I feel that I would be better off following the path that you prefer, Steven, than the Garland complex-css path. I've been programming for thirty years, in most of the languages available. I often found myself rewriting very complex, undocumented code because it was faster that figuring out someone else's style. Probably, it is more a part of my personality than anything else.

Michael

"I was going to buy a copy of The Power of Positive Thinking, and then I thought: What the hell good would that do?"
-- Ronnie Shakes

GreenMoon’s picture

I just installed Zen and like the clean look of it. I ran it through the CSS validator (http://jigsaw.w3.org/css-validator/) and found many strange problems, including typos. I corrected all of them and was about to move along to start customizing when I took a look at my site in IE (Firefox is my default). All of my 3rd column items show up either under the first column on some pages, or under the 2nd column on others. Only in IE -- it looks great in Firefox.

jwilde’s picture

I'm not having much success making them two different widths. For example, left-sidebar = 160 and
right-sidebar=240. Any ideas?

Thanks,

Jim

jefbak2’s picture

Also Firefox 2.02 is not wrapping long links in the body content text, it just pushes into the right sidebar.

I only have the Search box in the right sidebar so I could move it an dump the right side completely... if I knew how to css it that is.

Also my top header tabs are blank???

Chill35’s picture

Also Firefox 2.02 is not wrapping long links in the body content text, it just pushes into the right sidebar.

You will have to apply this rule to your node container element in garland/style.css:

div.node {
  width:100%;
  overflow:hidden;
}

Think twice before doing this. There are instances where it's useful to see the whole text, even if it looks ugly because of the overlap, such as for sample code examples and tables.

I only have the Search box in the right sidebar so I could move it an dump the right side completely... if I knew how to css it that is.

If you move the search box to another region, you no longer will have a right-side bar.

Caroline
A coder's guide to file download in Drupal
Who am I | Where are we
11 heavens

Rjae Easton’s picture

I think I have a simple ask: given the minimum width requirements of Garland's sidebars...how can we have the remainder of window width available for the center? As I test with the comments below I am - at best - affecting the width of the sidebar...but not the "buffer width" to left and right of sidebar. I am viewing Garland under 1920x1200 and there is significant waste to the left and right of the sidebars.

I will continue to hack and test...but if anyone has a concrete example that would save me time - I would appreciate the handout.

Thanks.

--
Rjae Easton
blog: http://applanet.com/percs/
wiki: http://applanet.com/wiki/

Rjae Easton’s picture

I answered my own request: max-width. Garland's style.css ver 5.1 sets #wrapper #container .max-width to 1270px. Change this to 100% and you get (full screen - sidebars) for center-width. Looks great! So far....(imo) there is nothing errant in Garland's style.

--
Rjae Easton
blog: http://applanet.com/percs/
wiki: http://applanet.com/wiki/

wydadi2003’s picture

Can any one please give an example of what the style.css file looks like after the changes made to make the right sidebar look correctly and not below the content?

Many many thanks,

I tried all the above and everytime "save config" , but no success with IE.

jacobjanzen’s picture

Rjae,

I have been trying to figure this out. I knew I had to set something to 100%, but hadn't picked that one yet, and was about to give up, until I read this page, and it's so beautiful now. Thank you so much for this post!

Thanks,

Jake

richardwo’s picture

Hi,
I've come up with a fairly messy way of reducing the width of the right hand column - but it works.

1. page.tpl.php
rename the class for div id="sidebar-left" from sidebar to e.g. class="my-sidebar-left"
rename the class for div id="sidebar-right" from sidebar to e.g. class="my-sidebar-right"

2. style.css
copy #wrapper #container .sidebar {...} twice. rename .my-sidebar-left and .my-sidebar-right
change the width in .my-sidebar-right, I used 80px

where .sidebar appears, add selectors for .my-sidebar-right and .my-sidebar-left :
a -
#watchdog-form-overview .form-submit,
.confirmation .form-submit,
.search-form .form-submit,
.poll .form-submit,
fieldset .form-button, fieldset .form-submit,
.sidebar .form-button, .sidebar .form-submit,
.my-sidebar-left .form-button, .my-sidebar-left .form-submit,
.my-sidebar-right .form-button, .my-sidebar-right .form-submit,
table .form-button, table .form-submit {
margin: 0;
}

b -
#wrapper #container .sidebar .block {,
#wrapper #container .my-sidebar-left .block,
#wrapper #container .my-sidebar-right .block,
{
margin: 0 0 1.5em 0;
}

then change the margins of the center element so it can expand out and use the extra space
body.sidebars #center {
/*was margin: 0 -210px;*/
margin: 0 -80px 0 -210px;
}

body.sidebars #squeeze {
/*was margin: 0 210px;*/
margin: 0 80px 0 210px;
}

Hope that helps.

wildlettuce’s picture

this works great! thank you.

mattjabs’s picture

If you have the event module installed, try editing the event.module file to change the display of the days of the week from 3 digits to 2 digits...that worked for me.

In any instance in the file (each appears 4 times, change all 4), where you see Mon, Tue, Wed, Thu, Fri, Sat, Sun...change them to Mo, Tu, We, Th, Fr, Sat, Sun respectively & you won't have the menu items shifting around anymore.

--
Matthew Jabs