By spanders on
I'm starting to develop a new theme, and would like to make the default homepage, and possibly a few pages within the site, 2 columns wide (2/3 & 1/3) but then the other pages 3 columns (1/4, 1/2, 1/4). This is all fixed width, 900px wide. Is that possible? How would I approach that when starting a new theme?
Comments
...
A couple of approaches. One is you can make page specific templates for the 2 column pages
front-page-tpl.php etc and then your page.tpl.php is just a standard three column. Or you can add logic in your page.tpl.php to detect if there are two or three columns.
here is an older 4.7 article but shows you the code theory for detecting columns and doing something based on if you have a right sidebar.
Drupal will automatically detect whether you are using 2 or 3 columns, it's figuring out the css to deal with multiple columns in one page that I found challenging which is why I did the logic method.
-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
Look at
the excellent new theme Tapestry from www.roopletheme.com. This does what you need, and it's free so you should be able to base your theme on some of its code.
Gareth