Drupal 7 Theming Changes

In einem sehr ausführlichen Blog Post macht pingVision Apetit auf die Neuerungen in Drupal 7.

Die Änderungen sind der Hammer! Drupal ist schon jetzt mein bevorzugtes CMS und die Änderungen machen es deutlich besser und flexibler. Eine kleine aber extrem praktische Änderung:

Previously, node content was output with a simple <?php print $content; ?>. Now $content is an array containing all fields related to the node. The render() function takes all of this data and renders it to a proper string for output. So if all you wanted to do is show a simple, complete dump of the node fields, you would use <?php print render($content); ?> instead. This would be missing the real advantage, though.

How is this "granular"? There is another facet to this function and that is that individual elements can be output. For example, if you wanted to output just the links in a node template you would add <?php print render($content['links']); ?> to it. As a bonus, this small piece of content will be flagged as already printed. This means you can use <?php print render($content); ?> afterwards and it will output everything but the links portion.

Possibly related posts (automatically generated)