Tuesday 20 April 2010 9:05:53 am
A crazy idea: why not get rid completely of override.ini? - it is not flexible enough: given the fact that the order of its blocks is important, you cannot have many extensions adding to it piecewise. This means extensions cannot easily ship with new content classes and templates that apply to them - separating override templates from standard ones makes little sense anyway. The net result is just doubling the number of directories where to search templates - it is hard to debug and prone to errors - many of the things achieved with using override templates can be achieved using an {if} statement within the template anyway (mostly true for 'site/specific' templates, as opposed to 'extension/generic' templates) A different proposal Put override templates in the same root dir as main templates, using different names and/or subfolders; Define override rules which are akin to css selectors: for a node selectors could be the node id, section and class (no more than 3 for sanity) For override templates, the filename is used to specify the selectors The chosen template would be the one that matches most selectors totaling the most weight. This means the tpl engine would look for the following files to display a node: /node/view/full/classidentifier#sectionid#node.tpl /node/view/full/#sectionid#node.tpl /node/view/full/classidentifier##node.tpl /node/view/full/##node.tpl ... /node/view/full/classidentifier##.tpl /node/view/full.tpl Comments are welcome...
Principal Consultant International Business
Member of the Community Project Board
|