Drupal Theme 学习心得

theme的一组可覆写列表参考:
http://api.drupal.org/api/drupal/includes--theme.inc/group/themeable/6

page.tpl.php

node.tpl.php

block.tpl.php
For example:
block-modulename-delta.tpl.php
block-modulename.tpl.php
block-region.tpl.php
block.tpl.php

block-user-1.tpl.php
block-user.tpl.php
block-left.tpl.php
block.tpl.php

block-user-3.tpl.php // Target just the Who's online block.
block-user.tpl.php // Target all block output by user module.
block-footer.tpl.php // Target all blocks in the footer region.
block.tpl.php // Target all blocks on any page.

comment.tpl.php

Let’s use the node editing page at http://example.com/?q=node/1/edit as an example.
Here’s the order of template files PHPTemplate would look for:
sites/all/themes/custom/greyscale/page-node-edit.tpl.php
modules/system/page-node-edit.tpl.php
sites/all/themes/custom/greyscale/page-node-1.tpl.php
modules/system/page-node-1.tpl.php
sites/all/themes/custom/greyscale/page-node.tpl.php
modules/system/page-node.tpl.php
sites/all/themes/custom/greyscale/page.tpl.php
modules/system/page.tpl.php

box.tpl.php

other.tpl.php

Note: Drupal looks at the internal system URL only, so if you’re using the path or pathauto modules,
which allow you to alias URLs, the page templates will still need to reference Drupal’s system URL and not
the alias. For example: page-user-1.tpl.php would only execute for the URLs of user/1, user/1/edit, and so on.

博客分类: 
Total votes: 1323

添加新评论