Accouncing a new "Sliced Bread Theme Snippets" section to the handbook
Hi everyone,
I've been promising (threatening) to do this for a while, so I took some time out to get it kick started over the last few weeks. It's based on the enormous success of the "Sliced Bread php Snippets" idea, which has grown considerably since it started in 2005.
It's a new approach to how themes and layouts are contributed to Drupal and is based on the following assumptions:
- There are very few themes being contributed to Drupal compared to modules
- Drupallers may not have the time to contribute their themes
- Drupallers may feel nervous about many people using their themes and every site looking the same as theirs
- Drupallers might prefer to have a distinctive and exclusive design/layout. (illustrated well by the responses to "Why can't I get the drupal.org theme?")
- It's quite a job to prepare a full theme for distribution - because of the sheer depth and dimensions to Drupal, it's not just a "skin" that is needed, it's a collection of themes that covers the front, blogs, lists, admin, comments, nodes etc.
- The first thing Drupallers do when they download a theme, is strip it apart
- It's much easier for Drupallers to contribute theme and layout snippets rather than full themes
Modular based theming
Drupal is 5 years old and it's incorrectly compared by some to other blogging or CMS tools where only a "skin" is really needed. The depth and dimensions to a Drupal site means a "skin" is not enough. I would argue that it is a collection of skins for specific areas and therefore it is difficult to expect the THEME DOWNLOADs section of the site to be just as populated as other sites.
So the logic behind the new "Sliced Bread" section of the handbook, is to approach theming on a modular basis. Where Drupallers submit theme and layout snippets, as opposed to full themes.
Sliced Bread Theming
The section is a work in progress and with the advent of Drupal 4.7, where phptemplate is the default theme engine, the obvious place to start was with phptemplate based snippets.
The final result will, hopefully, look something like this:
Drupal Theme Snippets
- blank canvas theme - a basic "blank canvas" theme that implements a standard naming convention for style classes and layouts making copying and pasting style (css) and tpl.php (layout) snippets easier and more intuitive
- Style (.css) snippets - A collection of CSS snippets that achieve a specific result and categorised into specific areas, such as page layouts (2-column, 3-column etc.), block styles, blogs, nodes, list, primary link style snippets etc. or mobile.css, pda.css, accesibility.css etc.
- layout (.tpl.php) snippets - a collection of .tpl.php snippets that achieve a specific result categorised into specific areas, such as node-blog.tpl.php snippets etc.
I have already kick started the tpl.php snippets section and the User profile page Snippets are already filling up with contributions.
Layout (.tpl.php) snippets
- Example - Theming the image gallery pages
- Example - Theming the user list pages
- Example - Theming the user profile pages
- User profile page Snippets
- Example - Theming flexinode
- Example - Theming the front page
- Example - Theming the blogs
- Example - Theming the links
- Example - Theming the primary or secondary links
that's all. I just wanted to flag this on the forum to let others know about it and hopefully, over time, it will receive the same support Drupallers have to the Sliced Bread Php Snippets section of the handbook.
Next on the list is to:
- setup the default "blank canvas" theme. Which is not only a base theme to work with, but it also validates, so Drupallers developing their own layout can start from a solid foundation block
- Setup the .css (Style) snippets section - ideally it should have an option to upload a screenshot illustration of how it looks.
- See how it progresses and if other Drupallers take to it in the same way as they did with the Sliced Bread Php Snippets, move it out of the handbook and into a dedicated section.
My gut feeling is that I think Drupallers will be more willing to submit Style (.css) and layout (.tpl.php) snippets quicker than they might submit a full theme.
Cheers
Dub

Nice idea. For what it's
Nice idea.
For what it's worth, I plan to contribute a very basic "blank canvas" theme soon. It'll be XHTML valid and source-ordered, with minimal CSS. It'll probably be ready by the end of Feb, assuming I get enough time to work on it. I hope it doesn't clash with any other attempts to submit a basic theme, but as we need to create one for the Drupal sites we build I thought it would be nice to submit it to the community.
I'll create a thread soon to discuss the "best" way of laying this theme out. (floats vs negative margins, etc).
demolicious | leafish
great!
Nice one Leafish...
don't let the new Sliced bread idea hold you back..please go ahead and unleash your theme on Drupal.org.
The idea shouldn't conflict with people who want to contribute full themes, but, my guess is that more people will contribute layout (tpl.php) and style (.css) snippets back to the "sliced bread theme snippets" section over time.
Another Drupaller emailed through a list of ALL the style classes that Drupal outputs out-of-the-box, so for the "blank canvas" theme, we will use that as the reference point and then build on that.
The main concept is really for designers who want total control with a modular approach.
for example, by standardising the style class names (in a similar way to how the drupaldocs.org lists all the PHP functions in Drupal) we can have a "Zen garden" type approach to style sheets - but on a modular basis.
for example:
the Zen Garden has a standard set of dummy text & stylesheet class names for each element. I envisage the same with the "sliced bread theme snippets" section, but, not just for the front page "skin", which is what Zen Garden essentially is.
So you have style snippets for all of the following items that can be used on top of the "Blank canvas theme" because we're using a standard set of class names:
The beauty of the phptemplate engine is that it also allows you a lot of control over how content is displayed, so you could copy and paste the list above for Style (.css) snippets and populate a layout (.tpl.php) section with the same titles -or more than likely a combination of the two...where there is a Style (.css) snippet to accompany a Layout (.tpl.php) snippet.
I hope that makes sense..it is an incredibly simple idea and based on the success of the Sliced Bread php snippets, I think that it will be something Drupallers will engage with over time.
I'll try and get the handbook page up soon with all the style class names as mentioned, so you can use that for reference for your new theme..
Dub
Great idea Dub, I think
Great idea Dub, I think snippets are the way to go BTW Do you (or anybody else for that matter) know about:
http://webhost.bridgew.edu/etribou/layouts/skidoo/
which was put together as a modular .css system... its been prepared so you can add extra bits of .css to switch between fixed/fluid designs or two/three col layouts - some very neat ideas which I think may be useful to build on.
><>tomskii
><>www.mutinyarts.co.uk
cheers
thanks tomskii,
Yeah. I've seen that site before., but, thanks for reminding me. There are agreat number of CSS sites out there, but what I'd like to see evolve is a Drupal-centric .CSS and .tpl.php layout respository over time.
I maybe wrong, but, I think the "Sliced bread snippets" snippets approach appears to work and maybe more valuable as a resource than hoping Drupallers submit full themes.
let's see how it goes with the handbook pages linked above and take it from there.
Thanks for that link..
Dub
class names list
Hi Dub,
What a great project. Do you have a copy of the class names yet? I'd love to build my new theme around these right from the start.
Secondly, have you considered breaking the .css into separate files, included into the main css via @import url("otherfile.css"); statements? If this were done, we could have separate css files for many different parts of the page, and building a theme would be as easy as replacing the various css files as required (rather than copy & pasting into one master CSS file).
Jeff
thats coming..
Hi Jeff
Thats the second phase of the new handbook section..where we have a "blank canvas" theme where there is a collection of style (CSS) snippets to sit alongside the .tpl.php (layout) snippets.
I got hit with a heavy workload recently, so, I'm slightly behind on getting it together. But it is on it's way.
I agree with you by the way. A modular approach to themeing is far more efficient than downloading a full theme and hacking away at that.
Dub
wow!
thanks everyone for submitting snippets...the pages are already getting a little too busy, so I'll re-organise them in a better way, so it's easier to find a snippet for your needs.
Dub
sliced bread snippets...update..
Hi Guys,
Thanks again for the updates. I have re-organised the new sliced bread PHPTEMPLATE Theme Snippets into a more logical fashion and added a link to the front page of the handbook, so they are easier to find.
Here's a quick list of what's in the section today (more to follow):
Dub