break;
}
+ // Create the user_picture variable.
+ $vars['user_picture'] = $vars['picture'];
+
// Special classes for nodes.
$classes = array('node');
+ // Class for node type: "node-type-page", "node-type-story", "node-type-my-custom-type", etc.
+ $classes[] = zen_id_safe('node-type-' . $vars['type']);
+ if ($variables['promote']) {
+ $variables['classes_array'][] = 'node-promoted';
+ }
if ($vars['sticky']) {
- $classes[] = 'sticky';
+ $classes[] = 'node-sticky';
}
if (!$vars['status']) {
$classes[] = 'node-unpublished';
if ($vars['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[] = zen_id_safe('node-type-' . $vars['type']);
+ if (isset($variables['preview'])) {
+ $variables['classes_array'][] = 'node-preview';
+ }
$vars['classes_array'] = $classes;
$vars['classes'] = implode(' ', $classes); // Concatenate with spaces
}
// $Id$
/**
- * @file node.tpl.php
- *
+ * @file
* 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().
+ * - $user_picture: The node author's picture from user-picture.tpl.php.
+ * - $picture: DEPRECATED. This variable has been renamed $user_picture in Drupal 7.
* - $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().
+ * - $name: Themed username of node author output from theme_username().
* - $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().
+ * - $classes: String of classes that can be used to style contextually through
+ * CSS. It can be manipulated through the variable $classes_array from
+ * preprocess functions. The default values can be one or more of the following:
+ * - node: The current template type, i.e., "theming hook".
+ * - node-[type]: The current node type. For example, if the node is a
+ * "Blog entry" it would result in "node-blog". Note that the machine
+ * name will often be in a short form of the human readable label.
+ * - node-teaser: Nodes in teaser form.
+ * - node-preview: Nodes in preview mode.
+ * The following are controlled through the node publishing options.
+ * - node-promoted: Nodes promoted to the front page.
+ * - node-sticky: Nodes ordered above other non-sticky nodes in teaser listings.
+ * - node-unpublished: Unpublished nodes visible only to administrators.
*
* Other variables:
* - $node: Full node object. Contains data that may not be safe.
* - $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.
+ * - $classes_array: Array of html class attribute values. It is flattened
+ * into a string within the variable $classes.
* - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
* teaser listings.
* - $id: Position of the node. Increments each time it's output.
?>
<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?>"><div class="node-inner">
- <?php print $picture; ?>
+ <?php print $user_picture; ?>
<?php if (!$page): ?>
- <h2 class="title">
- <a href="<?php print $node_url; ?>" title="<?php print $title ?>"><?php print $title; ?></a>
- </h2>
+ <h2 class="title"><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
<?php endif; ?>
<?php if ($unpublished): ?>
<?php if ($submitted || $terms): ?>
<div class="meta">
<?php if ($submitted): ?>
- <div class="submitted">
- <?php print $submitted; ?>
- </div>
+ <span class="submitted"><?php print $submitted; ?></span>
<?php endif; ?>
<?php if ($terms): ?>
- <div class="terms terms-inline"><?php print t(' in ') . $terms; ?></div>
+ <div class="terms terms-inline"><?php print $terms; ?></div>
<?php endif; ?>
</div>
<?php endif; ?>