danielebarchiesi@0
|
1 <?php
|
danielebarchiesi@0
|
2
|
danielebarchiesi@0
|
3 /**
|
danielebarchiesi@0
|
4 * @file
|
danielebarchiesi@0
|
5 * Default theme implementation to display a node.
|
danielebarchiesi@0
|
6 *
|
danielebarchiesi@0
|
7 * Available variables:
|
danielebarchiesi@0
|
8 * - $title: the (sanitized) title of the node.
|
danielebarchiesi@0
|
9 * - $content: An array of node items. Use render($content) to print them all,
|
danielebarchiesi@0
|
10 * or print a subset such as render($content['field_example']). Use
|
danielebarchiesi@0
|
11 * hide($content['field_example']) to temporarily suppress the printing of a
|
danielebarchiesi@0
|
12 * given element.
|
danielebarchiesi@0
|
13 * - $user_picture: The node author's picture from user-picture.tpl.php.
|
danielebarchiesi@0
|
14 * - $date: Formatted creation date. Preprocess functions can reformat it by
|
danielebarchiesi@0
|
15 * calling format_date() with the desired parameters on the $created variable.
|
danielebarchiesi@0
|
16 * - $name: Themed username of node author output from theme_username().
|
danielebarchiesi@0
|
17 * - $node_url: Direct URL of the current node.
|
danielebarchiesi@0
|
18 * - $display_submitted: Whether submission information should be displayed.
|
danielebarchiesi@0
|
19 * - $submitted: Submission information created from $name and $date during
|
danielebarchiesi@0
|
20 * template_preprocess_node().
|
danielebarchiesi@0
|
21 * - $classes: String of classes that can be used to style contextually through
|
danielebarchiesi@0
|
22 * CSS. It can be manipulated through the variable $classes_array from
|
danielebarchiesi@0
|
23 * preprocess functions. The default values can be one or more of the
|
danielebarchiesi@0
|
24 * following:
|
danielebarchiesi@0
|
25 * - node: The current template type; for example, "theming hook".
|
danielebarchiesi@0
|
26 * - node-[type]: The current node type. For example, if the node is a
|
danielebarchiesi@0
|
27 * "Blog entry" it would result in "node-blog". Note that the machine
|
danielebarchiesi@0
|
28 * name will often be in a short form of the human readable label.
|
danielebarchiesi@0
|
29 * - node-teaser: Nodes in teaser form.
|
danielebarchiesi@0
|
30 * - node-preview: Nodes in preview mode.
|
danielebarchiesi@0
|
31 * The following are controlled through the node publishing options.
|
danielebarchiesi@0
|
32 * - node-promoted: Nodes promoted to the front page.
|
danielebarchiesi@0
|
33 * - node-sticky: Nodes ordered above other non-sticky nodes in teaser
|
danielebarchiesi@0
|
34 * listings.
|
danielebarchiesi@0
|
35 * - node-unpublished: Unpublished nodes visible only to administrators.
|
danielebarchiesi@0
|
36 * - $title_prefix (array): An array containing additional output populated by
|
danielebarchiesi@0
|
37 * modules, intended to be displayed in front of the main title tag that
|
danielebarchiesi@0
|
38 * appears in the template.
|
danielebarchiesi@0
|
39 * - $title_suffix (array): An array containing additional output populated by
|
danielebarchiesi@0
|
40 * modules, intended to be displayed after the main title tag that appears in
|
danielebarchiesi@0
|
41 * the template.
|
danielebarchiesi@0
|
42 *
|
danielebarchiesi@0
|
43 * Other variables:
|
danielebarchiesi@0
|
44 * - $node: Full node object. Contains data that may not be safe.
|
danielebarchiesi@0
|
45 * - $type: Node type; for example, story, page, blog, etc.
|
danielebarchiesi@0
|
46 * - $comment_count: Number of comments attached to the node.
|
danielebarchiesi@0
|
47 * - $uid: User ID of the node author.
|
danielebarchiesi@0
|
48 * - $created: Time the node was published formatted in Unix timestamp.
|
danielebarchiesi@0
|
49 * - $classes_array: Array of html class attribute values. It is flattened
|
danielebarchiesi@0
|
50 * into a string within the variable $classes.
|
danielebarchiesi@0
|
51 * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in
|
danielebarchiesi@0
|
52 * teaser listings.
|
danielebarchiesi@0
|
53 * - $id: Position of the node. Increments each time it's output.
|
danielebarchiesi@0
|
54 *
|
danielebarchiesi@0
|
55 * Node status variables:
|
danielebarchiesi@0
|
56 * - $view_mode: View mode; for example, "full", "teaser".
|
danielebarchiesi@0
|
57 * - $teaser: Flag for the teaser state (shortcut for $view_mode == 'teaser').
|
danielebarchiesi@0
|
58 * - $page: Flag for the full page state.
|
danielebarchiesi@0
|
59 * - $promote: Flag for front page promotion state.
|
danielebarchiesi@0
|
60 * - $sticky: Flags for sticky post setting.
|
danielebarchiesi@0
|
61 * - $status: Flag for published status.
|
danielebarchiesi@0
|
62 * - $comment: State of comment settings for the node.
|
danielebarchiesi@0
|
63 * - $readmore: Flags true if the teaser content of the node cannot hold the
|
danielebarchiesi@0
|
64 * main body content.
|
danielebarchiesi@0
|
65 * - $is_front: Flags true when presented in the front page.
|
danielebarchiesi@0
|
66 * - $logged_in: Flags true when the current user is a logged-in member.
|
danielebarchiesi@0
|
67 * - $is_admin: Flags true when the current user is an administrator.
|
danielebarchiesi@0
|
68 *
|
danielebarchiesi@0
|
69 * Field variables: for each field instance attached to the node a corresponding
|
danielebarchiesi@0
|
70 * variable is defined; for example, $node->body becomes $body. When needing to
|
danielebarchiesi@0
|
71 * access a field's raw values, developers/themers are strongly encouraged to
|
danielebarchiesi@0
|
72 * use these variables. Otherwise they will have to explicitly specify the
|
danielebarchiesi@0
|
73 * desired field language; for example, $node->body['en'], thus overriding any
|
danielebarchiesi@0
|
74 * language negotiation rule that was previously applied.
|
danielebarchiesi@0
|
75 *
|
danielebarchiesi@0
|
76 * @see template_preprocess()
|
danielebarchiesi@0
|
77 * @see template_preprocess_node()
|
danielebarchiesi@0
|
78 * @see template_process()
|
danielebarchiesi@0
|
79 *
|
danielebarchiesi@0
|
80 * @ingroup themeable
|
danielebarchiesi@0
|
81 */
|
danielebarchiesi@0
|
82 ?>
|
danielebarchiesi@0
|
83 <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
|
danielebarchiesi@0
|
84
|
danielebarchiesi@0
|
85 <?php print $user_picture; ?>
|
danielebarchiesi@0
|
86
|
danielebarchiesi@0
|
87 <?php print render($title_prefix); ?>
|
danielebarchiesi@0
|
88 <?php if (!$page): ?>
|
danielebarchiesi@0
|
89 <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
|
danielebarchiesi@0
|
90 <?php endif; ?>
|
danielebarchiesi@0
|
91 <?php print render($title_suffix); ?>
|
danielebarchiesi@0
|
92
|
danielebarchiesi@0
|
93 <?php if ($display_submitted): ?>
|
danielebarchiesi@0
|
94 <div class="submitted">
|
danielebarchiesi@0
|
95 <?php print $submitted; ?>
|
danielebarchiesi@0
|
96 </div>
|
danielebarchiesi@0
|
97 <?php endif; ?>
|
danielebarchiesi@0
|
98
|
danielebarchiesi@0
|
99 <div class="content"<?php print $content_attributes; ?>>
|
danielebarchiesi@0
|
100 <?php
|
danielebarchiesi@0
|
101 // We hide the comments and links now so that we can render them later.
|
danielebarchiesi@0
|
102 hide($content['comments']);
|
danielebarchiesi@0
|
103 hide($content['links']);
|
danielebarchiesi@0
|
104 print render($content);
|
danielebarchiesi@0
|
105 ?>
|
danielebarchiesi@0
|
106 </div>
|
danielebarchiesi@0
|
107
|
danielebarchiesi@0
|
108 <?php print render($content['links']); ?>
|
danielebarchiesi@0
|
109
|
danielebarchiesi@0
|
110 <?php print render($content['comments']); ?>
|
danielebarchiesi@0
|
111
|
danielebarchiesi@0
|
112 </div>
|