Customizing how your blogs are displayed is extremely easy in Drupal using a phptemplate based theme. All you need to do is:
- Make a copy of your node.tpl.php file
- Rename it to node-blog.tpl.php
- in a text editor like notepad.exe or equivalent, edit the layout to suit your needs and upload it to your active theme folder
- Drupal will automatically pick up your new node-blog.tpl.php layout file and apply it
Available variables
- $title : Title of node.
- $node_url : Link to node.
- $terms : HTML for taxonomy terms.
- $name : Formatted name of author.
- $date : Formatted creation date.
- $sticky : True if the node is sticky on the front page.
- $picture : HTML for user picture, if enabled.
- $content : Node content, teaser if it is a summary.
- $links : Node links.
- $taxonomy (array) : array of HTML links for taxonomy terms.
- $node (object) : The node object.
- $main : True if the node is appearing in a context, like the front page, where only the teaser should be shown.
- $page : True if the node is being displayed by itself as a page.
- $submitted : Translated text, if the node info display is enabled for this node type.
Default template
print ($sticky) ? " sticky" : ""; ?>">
if ($page == 0): ?>
print $node_url ?>" title="print $title ?>">print $title ?>
endif; ?>
print $picture ?>
print $submitted ?>print $terms ?>
print $content ?>
if ($links): ?>
if ($picture): ?>
endif; ?>
print $links ?>
endif; ?>
No comments:
Post a Comment