[development] Making blocks from some setting in Drupal 7?
matt at mattfarina.com
matt at mattfarina.com
Mon Feb 25 14:35:52 UTC 2008
After a couple days thinking about this I have to agree and this fits
the PAC and MVC paradigms. t() is used for translations which is part
of the presentation layer. theme() calls are, also, part of the
presentation layer. So, I can see both of these making perfect sense
in .tpl.php files.
And, now that I've started to use regions in more unconventional ways,
like embedding the region in the node.tpl.php file[1], I can see not
wanting to build all regions on every page load.
[1] https://www.innovatingtomorrow.net/2007/12/11/how-embed-region-node
Quoting Earl Miles <merlin at logrus.com>:
> Matthew Farina wrote:
>> Putting function calls in the themes page.tpl.php file would be a
>> step backward for the theming system.
>
> Again, I must disagree with this assertion.
>
> We *must* allow calling the t() function in templates.
>
> We generally allow calling the theme() function in templates. (Note
> that doing regions is currently done with theme('blocks', 'regionname');
>
> This wouldn't be a step backward from our current setup; and the t()
> function itself poses a really special problem. It's difficult to put
> all text in preprocess functions, and if you put text in page.tpl.php
> then t() must be available for translation. Yes, this is a
> damned-if-you-do-damned-if-you-don't problem.
>
> Smarty and PHPTal are both capable of allowing function calls. Any
> templating system we use simply needs to be able to allow at least
> those 2 function calls
More information about the development
mailing list