Hi,
I'm starting out on theme development by customising Garland. I'm just a bit confused at the moment about sidebars and how they work inside page.tpl.php. In fact, it's more general than that, I'm confused by the various variables that are peppered all the way through the template, for example:
$left, $right, $content, $head, $styles, $scripts, $site_name, $site_slogan
I understand how they're being used inside the template, but I don't understand where they're all coming from, where they're defined, and, more importantly, where they're documented.
Basically, what I'm looking to do is to remove the right side bar entirely, and to hide the left sidebar on the front page only. I'm guessing that the easiest way to do that is to set the appropriate $left or $right variable to ''. After reading the docs, I thought the correct place to do this was phptemplate_preprocess_page() in template.php. But that didn't work :)
If anyone can give me a quick pointer in the right direction with my various confusions, I'd really appreciate it.
Many thanks
Andy
Comments
on your page.tpl.php
remove something like print $right to remove your right side bar
to hide the left sidebar on the front go to admin/build/block and configure all the block in the left sidebar ($left) to be invisible @ <front>
good luck
Martin
There is a Handbook section
There is a Handbook section on Drupal 6 theming
http://drupal.org/node/221881
and you can also look up the default template variables in the API
http://api.drupal.org/api/file/modules/system/page.tpl.php/6
http://api.drupal.org/api/file/modules/node/node.tpl.php/6
etc
The sidebars collect their content from the blocks configuration in Drupal, and are printed in the theme's page.tpl.php, where you could make that printing conditional.
Great, thanks for that. I'd
Great, thanks for that. I'd not realised that there were documentation pages for the template pages.
I'd seen the handbook section you mentioned, but I didn't find it to be the best introduction for someone like myself who's coming to it afresh.
Looking around, it seems like a lot of people have a lot of difficulties getting started with this stuff, and from my experience so far I'm not surprised. I've been coding for the best part of 20 years (in all sorts of areas including web), and I've found that Drupal certainly isn't easy to get into. To it's credit, it's very powerful, well coded, and there's loads of documentation, but it's just incredibly hard to make an initial start developing themes. I really hope that the indications that I've seen regarding a more dynamic layout system will come to fruition.
Modules seem fairly straight forward though, and I have no doubt that given time, Themes will become clear too - it's always the case with these things.
Anyway, in the mean time, it's a good job there are so many friendly chaps like yourselves to help out!
Thanks again :-)
A
=-=
There are video casts that show and tell you the ins and outs of themeing.
drupal-dojo.com is a good place to start and if the lullabots are in your area insure you try to get to their seminars lullabot.com
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )
Cool, thanks very much
Cool, thanks very much. I'll check those resources out.
A