Theming best practice for Drupal 6?

dokumori's picture

First I must admit theming is not something that I love and would die for. So where possible I outsource theming to excellent themers like ipwa. But sometimes I do have to do theming on my own.

Right now I'm working with a very talented front-end developer / themer and he has produced HTML mockups of a theme based on a graphic design. However he is not familiar with Drupal's theming system yet and  I'm building a theme (or I should say I'm theming a site) based on the markups he produced, which are semantic and really clean so it makes it easy to theme. I'm using *tpl.php files, as well as Semantic Views and Skinr modules to implement the theme. All I have to do is get the markups right and bang! elements get nicely styled with his CSS.

This is the first time for me to theme a site in this manner and I'm having a lot of fun with it. The problem I'm having though, is that, I don't find it the most efficient way when it comes to deployment. As far as I know, there are no options to export Semantic Views and Skinr's settings. When I build a theme, I usually 1) build it locally, 2) move it to the dev site for QA, and 3) move it to the live site. If I modify template and CSS files, there is no problem with the three-step process. All I do is run 'svn commit' locally, then run 'svn up' on the server. But with Semantic Views and Skinr, it involves too much clicks and Ctrl+C/V and really slows down the process that it makes me feel like I'm wasting so much time just replicating the changes.

So my question is 'with Drupal 6, is it possible to use semantic markups without so many bloody clicks and copy and pasting?' Or is there a best practice / guideline e.g. when to / when not to use Semantic Views and Skinr?

greg.harvey's picture

Hmm

I have no experience with either of these modules - my gut feeling is with something like Skinr only a click recorder will help, but could be good - create a macro and use it to deploy to each site. That way you do all the clicks and copying once and then just execute the macro wherever you need. Not sure if Devel might even do this?

Re: Semantic Views, probably better from a code perspective to not use it and instead over-ride the core Views templates (all in sites/all/modules/views/theme) - copy them to your theme and edit them as you need. That's what I would do. (That's what I *do* do... but then, like I say, never use Semantic Views myself.)

Same here

Same here. This sounds like a Semantic Views and Skinr deployment issue. I haven't used either of these but I usually approach theming this way (from design to non-drupal markup to theme). I would usually just use tpl files for each view that should have different markup. Although you have more files, the theme can be more maintainable in terms of understanding how to change part of a page and more flexible as it allows you to override specific parts of the site by simply altering the relevant template.

dokumori's picture

Right. Views template is the

Right. Views template is the way to go I think. Views 2 makes theming so much easier by providing all available templates, as well as the file names and content of the templates. I was astonished by it when I first found out.

I found Content Template (contemplat) useful at first but later realised it was evil. I feel that Semantic Views and Skinr can be the same for not making markups visible.

cryo's picture

Content template

I'm not sure about Semantic Views nor Skinr as i have not used them.

Views 2 building a page or block,  has alot of offers on theming and works really well although i find there are a lot of tpl files.Surprised

I find content template useful in regards to theming individual fields with my own CSS and DIVs as it nicely produces teaser and body variables for you to add.

I've only used content template with frameworks and garland theme. CryIt has been a problem sometimes and have used Devl to re-install module when it spued out errors usually after altering the CCK template, although this makes sense as it alters the tables. Also when i've updated with a HTML editor like FCK editor I've had to exclude the element from the contemplate templates as it seemed to abandon any previuos formatting.

The fusion of the two modules Views 2 and Content Template has worked for me so far, so good. Undecided Not sure if this is the way to go now you've mentioned Semantic Views and Skinr?  Will check them out though. Also i've have only used on small sites, with maybe a projects CCK or image gallery, with Views 2 page and block.

Devel is really good too to find pages or nodes and gives you suggested template names too, if there is no customised view for it.

I'm more a front-end (GUI) PSD to HTML/CSS designer so I guess a programmers mindset will look at theming differently?