Edit: The working group is: http://groups.drupal.org/themer-pack-working-group

It includes some minimal instructions (there should be much more after the Dojo session) and a signup wiki page.

Today on drupal.org I just posted my ‘personal battle plan’ and it includes a fairly large project that doesn’t actually require a great deal of Drupal experience to help on; it requires just enough coding knowledge to extract the right amount of code, create the files, and then — probably the only place where a little bit of coding knowledge is really needed — effectively separate logic from presentation without adding too much processing time to the code.

The idea here is that I think there should be a project called the Drupal 5 Themer Pack which includes every (or nearly every) theme function in Drupal 5 core as a .tpl.php and the corresponding template.php code. Right now I envision the structure that each Drupal ‘system’ might have a file such as template-forum.php which is included from your standard template.php. It includes all of the forum theme functions, and each one has a .tpl.php for presentation. This code does not change the output in any way but makes it easier for Drupal themers to identify the theme functions they need and actually modify them.

As a bonus, it might include alternate versions — maybe a PHPbb-like set of templates for forum, or whatever. Plug it in, make the changes you need, and go.

There is a fair bit of work here, but it’s also learning work — because in so doing, whoever extracts the theme functions will be forced to learn something about how Drupal actually does that part of the code. It could lead to recommendations for patches for future versions of Drupal to improve the theming functions, and it could make life a whole lot easier for themers who don’t want to have to know anything about code at all, because they can take these things that are already created for them and simply tweak them. That’s a lot easier than doing the actual extraction like they have to do now.

Right now I am basically doing an exploration of who might be interested in contributing to this project, and working to organize effort and get something good going here. I’m thinking of pitching this to the Drupal Dojo as something that students can work on as a learning exercise AND contribute to Drupal.

Any thoughts? Want to work on it? Make sure I have contact info — as I’ll be putting together a list.

I'm in

Where do I go, what do I do?!

Great idea. Please put me on the mailing list. I'm prepared to do some heavy lifting if needed.

Congratulations

This sounds like one of the best "feature" type plans for Drupal 6 thus far. As a PHP and CSS newbie, I can assure you that this will be very much appreciated. Drupal's theming functions are fairly easy to move around (editing Bluemarine type themes for personal use, etc.), but the actual making of a theme is, as far as I'm concerned, unintelligible.

This will make things a lot easier, I hope that this gets worked on.

Work already started...

Frando did some work to extract all of the themables into files. This is a GREAT place to start since it does some of the grunt work for us.

http://drupal.org/node/76596

A corrollary

A corollary to the theme pack is that once the work on this is complete (enough to be published) we can then encourage module developers to do *the same work* to their own modules and bundle mini theming packs with their modules!

Count me in!

Sounds like a great idea and something I can actually help with. Two things on my personal list are to become a 5.0 theme ninja and contribute more to Drupal, so this is a perfect place to start.

Drupal 5.0 experiments

Earl, for Drupal 5.0, Vlado, Adrian and myself spent a couple of weeks trying to move all theme functions out of the modules into stand-alone phpTemplate files. The idea is that designers should simply copy the template file and start modifying it, rather than having to convert a module into a theme themselves.

We created a script that does just that -- and that got us 95% there. It removes the theme functions from the modules, converts them to template files, and stores the template files in the module-specific directories.

It all worked (except for the last 5%), but the problem we ran into is that it turned out to be 10% slower.

I'm hoping you and others can pick up the work (with help from us), and help us get this _in_core_. I think this is a case where we are better of changing the default behavior. It makes too much sense not to do it in core -- plus, we already started working on it.

What needs to be done is "simply" this: we need to make it 10% faster. :-)

Let's talk more about this on the mailing list?

The 10% problem

I haven't seen the Dries/Vlado/Adrian code (URL anyone?), but having some familiarity with the current theme code, I would guess that the 10% slow down was caused by adding php calls to check for the existance of the new files and then opening those files.

Perhaps we could have the template.php file enable the use of stand-alone template files on a file-by-file basis.

In other words…

  • Each template.php would have a new callback that specifies which stand-alone template files it uses.
  • If the template doesn't use a specific stand-alone template file, the phptemplate.engine would just use the default callback.
  • If the template does use a specific stand-along template file, the phptemplate.engine could then skip the existance check for the file and simply include the file. A php error caused by missing files would be expected behavior since the template claimed the file existed.

Of course, this is all based on assumptions of code I haven't seen. :-p

Absolutely sounds perfect for a Dojo

I'm in the process of outlining a project/lesson plan for the Dojo. Essentially a real world 'how to build a Hyperlocal Media Network' (could be more of a newspaper/publishing platform) - cover all aspects from planning, development, to marketing and fundraising (ie giving back to drupal). All learning materials, courseworks, modules, themes, and the products/distros themselves would be available to the community.

Theming/templating and how to best utilize modules such as views and panels would be big parts of the project, so possibly there are opportunities to integrate some of your projects/battle plans into this sort of Dojo/lesson framework?

I'll post the outline on the relevant Drupal sites when its a bit more coherent.

Great stuff, Earl - Thanks!

Probably better off starting from the use cases

I have sort of a question here (and some proposals also). Once I was doing a project for someone who wanted to take advantage of the theme switching functionality that Drupal has, while at the same time needing some heavy theming (presentation functionality) common among all themes. I had to make a module, because it was either a module or replicate everything in all the themes to keep the theming and the theme switching.

At that time I dreamed of a kind of "theming abstraction layer" around the theming engine. A kind of phptemplate which had an editable/extensible part around the theme engine itself, so that if someone wanted, they could affect "all" themes (associated with the theme engine of course). This kind of thinking might have something to do with the speed problem also.

Anyway, that may or may not be possible/desirable for most, and I think your idea is a great step forward to Drupal usability. I would love to participate in some way. We already have touched on this in a couple of Dojo classes (copying theme function to template file) and it will be a wonderful (apprentice rather than dojo, with occasional dojo help, I think) effort.

I think it would be better identifying a series of use cases (phpbb, newspaper publishing, "community" (profile theming with custom css, mypage theming, etc), software development collaboration site, what have you.

Then people could pair/team together on a use case basis and do a fun "treasure hunt" for what they need on the basis of the exercise you are proposing. Once several get under way, that 90% is hit (it will be a different 90%). Then some volunteers can do a mop-up operation. Others can work on the optimization question. There will be a continual process of refactoring on the basis of lessons learned (all teams would publish their efforts).

I would like to work on a community/newspaper publishing effort (maybe text columns, placement/theming of additional fields for the story, feature pages, countless other things) and I would like to start from the use cases, and as few modules as possible (maybe aggregation or aggregation-type module or import type module (use of importexport module) to import stories already written for hard copy into the web environment), get the basic functionality going on a clean 5.0 installation, then do the exercise you propose.

And like Josh, you should make a group on http://groups.drupal.org/, you won't have to necessarily lead it, or spend much time working with it, but it would centralize our efforts and make it economical to work together, choose pairs, groups, and report work done. Another alternative (talk to Josh) would be just to use a thread on Dojo, but it's all the same to most people I think.

Victor Kane
victorkane@drupal.org (for contact info)
http://awebfactory.com.ar

The Holy Pack?

As a designer, all these new projects sound like a blessing.
Figuring out what is themable -and to what extent- has often been a problem to me.

Themer Pack vs Sympal vs Core

I really think you need to outline how you see this project as being different from Ber's Sympal 'theme' :)
I'll post further comments to the list.

it would be great!

instead of looking through 10 tons of drupal nodes / mailliste / own notes hidden under coffey stains it would be pretty f*cking nice to hear a collection of files just to dig in

So count me in :)

Theming functions wizard

From a UI point of view, what we need is a theming wizard, that will allow the theme developer to visually select the theming function from the right file.

Drupal Theme Packs

This is interesting, but I'm not sure how useful it would be. One thing that might be useful is to create small packs of alternatively themed core functions that focus on changing just a specific part of Drupal. Sort of like a library you could import.

the idea is not bad. I would

the idea is not bad. I would however rather use external forum on the basis of phpbb. There you have at least no problems with templates.

Count me in!

Sounds like a great idea and something I can actually help with. Two things on my personal list are to become a 5.0 theme ninja and contribute more to Drupal, so this is a perfect place to start.

Post new comment

The content of this field is kept private and will not be shown publicly.