I've built several Drupal sites now, and I usually start with the Zen theme and work my designs around that code. One reason is that I am confident that Zen has all the code needed in the right places (php files etc...).
I dig it and it works great, but I wonder if it's worth coding a design from scratch by inputing the PHP. So, basically theming from scratch.
Do you guys do that? and if so, would you recommend any resources for bottom-up theming? would you say it's a worthwhile endeavor? or start from a pre-built theme like Zen?
paul del signore








Always!
Personaly, I start from scratch 100% of the time. I always think that starting from someone else's work is something that should be avoided if possible. The reason? I guess there's a couple that come to mind:
So, there's a few reasons why I start from scratch. Honestly, I've always been amazed at the big deal people make this...starting from scratch is EASY and you only need a small handfull of necessary php snippets (probably 10 tops). Otherwise, it's just like building an html page.
So, sorry, I don't have any resorces...but gee, maybe this is another push to create some
-Rob Feature
Geeks and God Co-Host
www.mustardseedmedia.com
funny you should say that...
I was thinking only yesterday about possible series topics you might want to do for screencasts, and this would be pretty high up on the list... maybe even "-10" in drupal-weighting-speak!
Cheers
Pete
www.sneesby.com.au
www.lifesourcetv.com
Theming from Scratch
Hey Paul,
To build upon what Rob said; build a static HTML page as you normally would. Insert print calls where static content would normally appear in the form of:
<?php print $content; ?>ensuring each contains the appropriate variable. Then save it as page.tpl.php.Blessings!
-NP
$?
"you only need a small handfull of necessary php snippets."
Hey Rob, which to you use most? I'm guessing...
$closure
$content
$footer_message
$head
$logo
$primary_links
$search_box
$sidebar_left
$sidebar_right
$site_name
Blessings!
-NP
Variables
Hey NP, here's the variables I use in my page.tpl and 99% of the time, these are the ONLY variables i use:
$head_title
$head
$styles
$scripts
$tabs
$help
$messages
$content
$primary_links ($secondary if needed)
$sidebar_right (sometimes _left if I need it)
$footer_message
$closure
That's it....I don't use $logo or $mission or any of that stuff because I build that right into the theme. Not sure if that's interesting or not, but there's an answer.
-Rob Feature
Geeks and God Co-Host
www.mustardseedmedia.com
theme vs. content?
Hmmm Rob, this is interesting! Is that to separate theming elements from the content? Blessings! -NP
Yes indeed
Yes indeed, NP....
Let's just look at logo as an example. A logo isn't (or shouldn't) be part of your content (usually). Instead, it's a visual item that should really function as part of your theme. (a good test between styling or content is: "Would a blind user care about this?"...if not, it's probably part of your theme)
Normally with my logo, it's actually a CSS replacement of my sitewide title in an h1 tag. The h1 would be the site name (yes, blind users care about that text) but the logo itself is just eye candy.
Make sense?
-Rob Feature
Geeks and God Co-Host
www.mustardseedmedia.com
Thanks much!
Yup, I'm with ya, Rob. Thanks much! -NP
CSS Framework
I agree with Rob on this. I theme it from scratch every time.
There are cases where you may use something like a very basic page template but I would not start with another theme. If anything I would start with a theme/template framework. Kind of like a drupal for themeing. It's not a theme itself but it lets you build a theme quicker by giving common tools.
In that case something to consider is http://code.google.com/p/bluep... and there is a drupal module in development to implement this at http://drupal.org/project/blue...
Though, I can't recommend this since I have not used or seen it in action yet. Just throwing out ideas.
Matt Farina
Geeks and God Co-Host
www.innovatingtomorrow.net
www.mattfarina.com