[drupal-devel] [feature] Make $node->type a class in the main div of the default node.tpl.php

adrian drupal-devel at drupal.org
Tue May 10 11:30:27 UTC 2005


Issue status update for http://drupal.org/node/22487

-Project:      PHPTemplate
+Project:      Drupal
-Version:      cvs
+Version:      cvs
-Component:    Code
+Component:    theme system
 Category:     feature requests
 Priority:     normal
 Assigned to:  willmoy
 Reported by:  willmoy
 Updated by:   adrian
 Status:       patch

You could also just copy node.tpl.php to your theme dir and modify it
there to user $node->type, and if you only want to do something for
forum nodes, you could copy the node.tpl.php to node-forum.tpl.php


PHPTemplate has been moved to core for 4.7, so I will only accept this
patch for the 4.6 branch if it is accepted into core. Otherwise your
templates will just magically stop working.




adrian



Previous comments:
------------------------------------------------------------------------

May 10, 2005 - 03:36 : willmoy

Attachment: http://drupal.org/files/issues/nodetype_theming.patch (716 bytes)

This patch would change the main div of, for example, a sticky book node
from:
<div class="node sticky">
to:
<div class="node node-book sticky">


This is to aid theming; motivated by trying to theme forums differently
from pages etc.


It uses the same convention as node type-specific blocks (e.g.
class="block block-book") and it is should be completely backward
compatible so long as people do not have very odd tastes in class
names.







More information about the drupal-devel mailing list