The theming is Drupal is fairly straightforward, however runs into styling tags added before hand in the php files. Then you go have to look them up, figure out what is going on and this can be a lot of extra work. It would be easiest to be able to pull the data without any tags and add the tags later, however this would make it difficult with the php sometimes if I look at the code (repeat data for a menu for example which need the li (W3C)). I notice that I loose a lot of time to figuring these things out in theming. I heard Drupal on the Lullabot podcasts that people are looking at find easier/ better ways to theme. This is just an idea and I don't know if it could be made workable and what the load time would be.

Say you would create a 'layout.php' in the theme folder.
(and the file could be named something else, but a name preferable something to do with layout.)

Then in this file you could define which tag and class/ id you would want to give a piece of data.

$date_h1_id=heading-date
$date_p_class=story-date

but if there is a module added to the project. You could also add:

$date_p_module-name_class=story-date
$date_p_module-name__name-of-node-type_class=story-date

or for example:

$links_name-of-node-type_ul_class=class-name-here
$links_name-of-node-type_li__class=class-name-first-link
$links_name-of-node-type_li_class=class-name-last-link

or

$links_module-name_name-of-node-type_ul_class=class-name-here
$links_module-name_name-of-node-type_li__class=class-name-first-link
$links_module-name_name-of-node-type_li_class=class-name-last-link

As a designer you really want to be able to add any tag and any id/ class to any piece of data. This gives enormous amount of design freedom. You could save some overhead, possibly, because modules don't have to add their tags id/classes in their own files. A module writer could add a list of the used tags in the read me which you could then override in the layout.php. Also you could possible use cache. (I don't know much about programming side of this area) As a themer you would just have to learn how the 'layout.php' works to style away.

It would be nicest if there was just one <'?php' tag at the beginning and one '?'> tag in the end.
And keep the layout of the file simple. Something similar to css would be great as designers already know this. Or something similar to .htaccess or robots.txt style. Just to give some ideas.

I don't know what the best way of ordening it would be. By style tag (p,h1), id, class or module name or node type. I guess the most consistant would be by the style tag, but I don't know this for sure. This can be tested.

The W3C for this I feel should be left to the responsibility of the designer, this would allow to keep it as open as possible.

And I am not even sure if this could work. How error prone this would be, how secure, how fast. For me personally it would make working easier. I don't know about other people.

If any people have ideas, suggestions or comments on this of course they are welcome.

p.s. I really don't know what to call the title of this topic. If there is a better title I will change it. Please let me know.

Comments

Pasqualle’s picture

Version: 6.1 » 7.x-dev
Component: base system » theme system
dvessel’s picture

Status: Active » Closed (won't fix)

What you're describing sounds like another tagging language. It would be another thing to learn and the overhead would be pretty substantial.

To be able to have this possible would require a rewrite of the whole theming system. Laying out all the tags in one file would not work without redoing the whole structure of how theming hooks interact to output the markup. Each hook, i.e., theme('block') is discrete and self contained making it easier to work with. Finding it may be difficult but there's devel themer. Placing every possible hook on one file would turn into a colossal mess.