[development] Node Rendering Debate
adrian rossouw
adrian at bryght.com
Thu Jun 21 21:53:54 UTC 2007
On 21 Jun 2007, at 11:23 PM, Farsheed wrote:
> +infinity for this. I really feel like template files
> should only have straight variables and simple logic.
In drupal 5 parlance (not really sure how drupal 6 does it yet) :
$vars = $node;
array_walk($vars, "drupal_render");
return _phptemplate_callback("node", array("node" => $node) + $vars);
I am 100% against you needing to use an interface to assign variable
names, because it makes
node template un-distributable, without distributing the additional
configuration too.
Also, I don't think a drupal_render call over and above the already
existing print call is too much to ask,
because quite frankly we are already going to be requiring it for
localisation (ie: print t("Some text") ).
Also. there's a difference between themers , and end users. Requiring
an interface to be able to assign
variables is going to help the latter, but not the former. It's going
to make their life more complicated.
What I really think we should do, if we want to make an interface for
the latter, is make a proper version of the contemplate
module, using the token replacement code (ie: use %my_field) in the
text editor to place field, with a list of possible
tokens.
That then translates to <? print drupal_render($node['my_field']);?>
in the final template file it uses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070621/1afc3a16/attachment.htm
More information about the development
mailing list