Op donderdag 9 maart 2006 12:23, schreef Adrian Simmons:
You're losing me here. If you updated the module you'd need to update the module.tpl.php, and maybe the module.css. You've gone from two files to three - all of which (if I understand Adrian's proposal correctly) are sitting in modules/modulename/ anyway? Going from two to three files per module doesn't seem all that much harder.
You're right, that from the module builders end this would make things more complicated and create some extra work. But from the theme-builders end things would get easier.
If I change the way my theme function works, I suddenly need to do this ni two locations. The calling and implentation no longer live in the same location.
e.g. theme_coffeemug_print($image); In the current system the caller theme('coffeemug_print', $image); and the function theme_coffeemug_print($image); live in one file.
I now want to add a $location theme_coffeemug_print($image, $location) if its on file, this is rather easy to do. But if I have to do this in two places, its going to be hard to maintain [1].
I love the fact that our modules are most of the times selfcontaining: one file has it all. This, in fact is one thing I dislike about, for example flexinode. During development and upgrades, i have always had trouble with one (or more) of the .inc staying behind, becoming stale, conflicting etc. More then once I had to rush into vi to hand-edit such a file.
Another thing that strikes me as not-so-good is that IMO a theme and a module are two different layers in Drupal.
Having my theme spread over /themes/MyTheme/ and in /modules/*/*tpl.php is not my idea of clean and simpler development. The solution would be to move stuff around on _install strikes me as even less then ideal.
My solution, the one i am working on right now is the scaffolding stuff I am doing for sympal_scripts. I tested a system that * calls drupal, checks for all node_types that are enabled. * takes a template node-type.tpl.php parses that to add some varibles in place of tokens * puts that in /sites/mysite.com/themes/mysite_custom_theme/node-$type.tpl.php Already workes on my laptop, but has some ugly apache/php permission issues, that i need so solve more globally.
*I* (note the stress on the I) think that route I layout here, IE scaffolding and so, is a far better one for Drupal. In any way, a better one for us, developers and consultants. Joe with winzip, ws_ftp and plesk will not be able to use this, unfortunately.
Bèr
[1] maintainance includes CVS repositories, readme, updates done by all users, etc.