summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt2
-rw-r--r--zen/node-forum.tpl.php31
-rw-r--r--zen/node.tpl.php82
-rw-r--r--zen/template.php12
-rw-r--r--zen/zen.css6
5 files changed, 77 insertions, 56 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 35e8250..cf3e537 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -3,7 +3,7 @@ Zen 6.x-1.x-dev
#263228: Allow sub-themes to override wireframes.css
#260605: Can't override block-editing.css
#308266: Don't display footer if no footer message or footer blocks
- * Changed $block_classes to $classes and $comment_classes to $classes
+ * Changed $block_classes to $classes and $comment_classes to $classes and $node_classes to $classes
#290838 by thehong: Only display comments block when comments content is not empty
* Don't display comment wrapper title on forums
#299397: Synchronize Zen's tpl files with core's tpl files
diff --git a/zen/node-forum.tpl.php b/zen/node-forum.tpl.php
deleted file mode 100644
index 2337e4d..0000000
--- a/zen/node-forum.tpl.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<div class="<?php print $classes; ?>" id="node-<?php print $node->nid; ?>"><div class="node-inner">
-
- <?php if ($page == 0): ?>
- <h2 class="title">
- <a href="<?php print $node_url; ?>"><?php print $title; ?></a>
- </h2>
- <?php endif; ?>
-
- <?php if ($unpublished): ?>
- <div class="unpublished"><?php print t('Unpublished'); ?></div>
- <?php endif; ?>
-
- <?php if ($picture) print $picture; ?>
-
- <?php if ($submitted): ?>
- <div class="submitted">
- <?php print $submitted; ?>
- </div>
- <?php endif; ?>
-
- <div class="content">
- <?php print $content; ?>
- </div>
-
- <?php if ($links): ?>
- <div class="links">
- <?php print $links; ?>
- </div>
- <?php endif; ?>
-
-</div></div> <!-- /node-inner, /node -->
diff --git a/zen/node.tpl.php b/zen/node.tpl.php
index 8efea72..778de29 100644
--- a/zen/node.tpl.php
+++ b/zen/node.tpl.php
@@ -1,8 +1,60 @@
-<div class="<?php print $classes; ?>" id="node-<?php print $node->nid; ?>"><div class="node-inner">
+<?php
+// $Id$
- <?php if ($page == 0): ?>
+/**
+ * @file node.tpl.php
+ *
+ * Theme implementation to display a node.
+ *
+ * Available variables:
+ * - $title: the (sanitized) title of the node.
+ * - $content: Node body or teaser depending on $teaser flag.
+ * - $picture: The authors picture of the node output from
+ * theme_user_picture().
+ * - $date: Formatted creation date (use $created to reformat with
+ * format_date()).
+ * - $links: Themed links like "Read more", "Add new comment", etc. output
+ * from theme_links().
+ * - $name: Themed username of node author output from theme_user().
+ * - $node_url: Direct url of the current node.
+ * - $terms: the themed list of taxonomy term links output from theme_links().
+ * - $submitted: themed submission information output from
+ * theme_node_submitted().
+ *
+ * Other variables:
+ * - $node: Full node object. Contains data that may not be safe.
+ * - $type: Node type, i.e. story, page, blog, etc.
+ * - $comment_count: Number of comments attached to the node.
+ * - $uid: User ID of the node author.
+ * - $created: Time the node was published formatted in Unix timestamp.
+ * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
+ * teaser listings.
+ * - $id: Position of the node. Increments each time it's output.
+ *
+ * Node status variables:
+ * - $teaser: Flag for the teaser state.
+ * - $page: Flag for the full page state.
+ * - $promote: Flag for front page promotion state.
+ * - $sticky: Flags for sticky post setting.
+ * - $status: Flag for published status.
+ * - $comment: State of comment settings for the node.
+ * - $readmore: Flags true if the teaser content of the node cannot hold the
+ * main body content.
+ * - $is_front: Flags true when presented in the front page.
+ * - $logged_in: Flags true when the current user is a logged-in member.
+ * - $is_admin: Flags true when the current user is an administrator.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_node()
+ */
+?>
+<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?>"><div class="node-inner">
+
+ <?php print $picture; ?>
+
+ <?php if (!$page): ?>
<h2 class="title">
- <a href="<?php print $node_url; ?>"><?php print $title; ?></a>
+ <a href="<?php print $node_url; ?>" title="<?php print $title ?>"><?php print $title; ?></a>
</h2>
<?php endif; ?>
@@ -10,26 +62,24 @@
<div class="unpublished"><?php print t('Unpublished'); ?></div>
<?php endif; ?>
- <?php if ($picture) print $picture; ?>
+ <?php if ($submitted or $terms): ?>
+ <div class="meta">
+ <?php if ($submitted): ?>
+ <div class="submitted">
+ <?php print $submitted; ?>
+ </div>
+ <?php endif; ?>
- <?php if ($submitted): ?>
- <div class="submitted">
- <?php print $submitted; ?>
+ <?php if ($terms): ?>
+ <div class="terms terms-inline"><?php print t(' in ') . $terms; ?></div>
+ <?php endif; ?>
</div>
<?php endif; ?>
- <?php if (count($taxonomy)): ?>
- <div class="taxonomy"><?php print t(' in ') . $terms; ?></div>
- <?php endif; ?>
-
<div class="content">
<?php print $content; ?>
</div>
- <?php if ($links): ?>
- <div class="links">
- <?php print $links; ?>
- </div>
- <?php endif; ?>
+ <?php print $links; ?>
</div></div> <!-- /node-inner, /node -->
diff --git a/zen/template.php b/zen/template.php
index a5a7e68..8ec3430 100644
--- a/zen/template.php
+++ b/zen/template.php
@@ -168,23 +168,21 @@ function zen_preprocess_node(&$vars, $hook) {
if ($vars['sticky']) {
$classes[] = 'sticky';
}
- if (!$vars['node']->status) {
+ if (!$vars['status']) {
$classes[] = 'node-unpublished';
$vars['unpublished'] = TRUE;
}
else {
$vars['unpublished'] = FALSE;
}
- if ($vars['node']->uid && $vars['node']->uid == $GLOBALS['user']->uid) {
- // Node is authored by current user
- $classes[] = 'node-mine';
+ if ($vars['uid'] && $vars['uid'] == $GLOBALS['user']->uid) {
+ $classes[] = 'node-mine'; // Node is authored by current user.
}
if ($vars['teaser']) {
- // Node is displayed as teaser
- $classes[] = 'node-teaser';
+ $classes[] = 'node-teaser'; // Node is displayed as teaser.
}
// Class for node type: "node-type-page", "node-type-story", "node-type-my-custom-type", etc.
- $classes[] = 'node-type-' . $vars['node']->type;
+ $classes[] = 'node-type-' . $vars['type'];
$vars['classes'] = implode(' ', $classes); // Concatenate with spaces
}
diff --git a/zen/zen.css b/zen/zen.css
index d68fbd7..e22e03b 100644
--- a/zen/zen.css
+++ b/zen/zen.css
@@ -349,11 +349,15 @@
position: relative; /* Otherwise floated pictures will appear below the "Unpublished" text. */
}
+ .node .meta /* Wrapper for submitted and terms data */
+ {
+ }
+
.node .submitted /* The "posted by" information */
{
}
- .node .taxonomy /* Node taxonomy (categories) */
+ .node .terms /* Node terms (taxonomy) */
{
}