[documentation] [task] Optionally theming a node

starbow drupal-docs at drupal.org
Fri Feb 24 05:51:40 UTC 2006


Issue status update for 
http://drupal.org/node/51080
Post a follow up: 
http://drupal.org/project/comments/add/51080

 Project:      Documentation
 Version:      <none>
 Component:    Developer Guide
 Category:     tasks
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  starbow
 Updated by:   starbow
 Status:       active

This should go as a child of http://drupal.org/node/46012


If you want to sometimes theme a certain type of node, but othertimes
want to just let the default node theme apply, you can use this
(slightly black magic) snippet in your node-/type/.tpl.php



<?php if ($node->do_special_handling) { ?>


  // custom theming goes here

<?php } else {
  print _phptemplate_callback('node', compact('node', 'title',
'content', 'links', 'page', 'submitted', 'picture', 'terms', 'sticky',
'node_url', 'name', 'date', 'taxonomy', 'main'));
} ?>






starbow



More information about the documentation mailing list