Theme node body with a template file in the feature

Theme node body with a template file in the feature

This code can be used to add tpl.php files instead of implementing theme functions to your feature array( 'template' => 'myfeature-node-body', 'arguments' => array('node' => null), ), ); } /** * Implementation of hook_nodeapi(). */ function myfeature_nodeapi(&$node, $op, $a3, $a4) { if ($node->type == 'mytype') { switch($op) { case 'view': $node->content['body'] = array( '#value' => theme('myfeature-node-body', $node), '#weight' => 10, ); break; case 'load': //add any extra data your template needs to $node here break; } } }

Related Posts

Drupal Theming - A Basic Primer on Template.php and Template Files

Kristin Brinner
Read more

Free Drupal Theme: Jackson (NineSixty Sub-theme)

Brent Bice
Read more

Unleashing the Power of Drupal on Your Theme

Mark Carver
Read more

Working with File Fields in Drupal 7

Tom McCracken
Read more

Drupal and Google Analytics - How to Track Downloads when using the File Entity Module

Kristin Brinner
Read more

You Never Forget Your First...Drupal Theme

Chris Sloan
Read more