#547696: Update node.tpl to use ideas from D7
[project/zen.git] / templates / node.tpl.php
1 <?php
2 // $Id$
3
4 /**
5 * @file
6 * Theme implementation to display a node.
7 *
8 * Available variables:
9 * - $title: the (sanitized) title of the node.
10 * - $content: Node body or teaser depending on $teaser flag.
11 * - $user_picture: The node author's picture from user-picture.tpl.php.
12 * - $picture: DEPRECATED. This variable has been renamed $user_picture in Drupal 7.
13 * - $date: Formatted creation date (use $created to reformat with
14 * format_date()).
15 * - $links: Themed links like "Read more", "Add new comment", etc. output
16 * from theme_links().
17 * - $name: Themed username of node author output from theme_username().
18 * - $node_url: Direct url of the current node.
19 * - $terms: the themed list of taxonomy term links output from theme_links().
20 * - $submitted: themed submission information output from
21 * theme_node_submitted().
22 * - $classes: String of classes that can be used to style contextually through
23 * CSS. It can be manipulated through the variable $classes_array from
24 * preprocess functions. The default values can be one or more of the following:
25 * - node: The current template type, i.e., "theming hook".
26 * - node-[type]: The current node type. For example, if the node is a
27 * "Blog entry" it would result in "node-blog". Note that the machine
28 * name will often be in a short form of the human readable label.
29 * - node-teaser: Nodes in teaser form.
30 * - node-preview: Nodes in preview mode.
31 * The following are controlled through the node publishing options.
32 * - node-promoted: Nodes promoted to the front page.
33 * - node-sticky: Nodes ordered above other non-sticky nodes in teaser listings.
34 * - node-unpublished: Unpublished nodes visible only to administrators.
35 *
36 * Other variables:
37 * - $node: Full node object. Contains data that may not be safe.
38 * - $type: Node type, i.e. story, page, blog, etc.
39 * - $comment_count: Number of comments attached to the node.
40 * - $uid: User ID of the node author.
41 * - $created: Time the node was published formatted in Unix timestamp.
42 * - $classes_array: Array of html class attribute values. It is flattened
43 * into a string within the variable $classes.
44 * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
45 * teaser listings.
46 * - $id: Position of the node. Increments each time it's output.
47 *
48 * Node status variables:
49 * - $build_mode: Build mode, e.g. 'full', 'teaser'...
50 * - $teaser: Flag for the teaser state (shortcut for $build_mode == 'teaser').
51 * - $page: Flag for the full page state.
52 * - $promote: Flag for front page promotion state.
53 * - $sticky: Flags for sticky post setting.
54 * - $status: Flag for published status.
55 * - $comment: State of comment settings for the node.
56 * - $readmore: Flags true if the teaser content of the node cannot hold the
57 * main body content.
58 * - $is_front: Flags true when presented in the front page.
59 * - $logged_in: Flags true when the current user is a logged-in member.
60 * - $is_admin: Flags true when the current user is an administrator.
61 *
62 * @see template_preprocess()
63 * @see template_preprocess_node()
64 */
65 ?>
66 <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?>"><div class="node-inner">
67
68 <?php print $user_picture; ?>
69
70 <?php if (!$page): ?>
71 <h2 class="title"><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
72 <?php endif; ?>
73
74 <?php if ($unpublished): ?>
75 <div class="unpublished"><?php print t('Unpublished'); ?></div>
76 <?php endif; ?>
77
78 <?php if ($submitted || $terms): ?>
79 <div class="meta">
80 <?php if ($submitted): ?>
81 <span class="submitted"><?php print $submitted; ?></span>
82 <?php endif; ?>
83
84 <?php if ($terms): ?>
85 <div class="terms terms-inline"><?php print $terms; ?></div>
86 <?php endif; ?>
87 </div>
88 <?php endif; ?>
89
90 <div class="content">
91 <?php print $content; ?>
92 </div>
93
94 <?php print $links; ?>
95
96 </div></div> <!-- /node-inner, /node -->