Projet

Général

Profil

Paste
Télécharger (6,46 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / adaptivetheme / at_core / templates / node.tpl.php @ 87dbc3bf

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

    
100
/**
101
 * Hide Content and Print it Separately
102
 *
103
 * Use the hide() function to hide fields and other content, you can render it
104
 * later using the render() function. Install the Devel module and use
105
 * <?php dsm($content); ?> to find variable names to hide() or render().
106
 */
107
hide($content['comments']);
108
hide($content['links']);
109
?>
110
<article id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
111
  <?php print render($title_prefix); ?>
112

    
113
  <?php if ($title && !$page): ?>
114
    <header<?php print $header_attributes; ?>>
115
      <?php if ($title): ?>
116
        <h1<?php print $title_attributes; ?>>
117
          <a href="<?php print $node_url; ?>" rel="bookmark"><?php print $title; ?></a>
118
        </h1>
119
      <?php endif; ?>
120
    </header>
121
  <?php endif; ?>
122

    
123
  <?php if(!empty($user_picture) || $display_submitted): ?>
124
    <footer<?php print $footer_attributes; ?>>
125
      <?php print $user_picture; ?>
126
      <p class="author-datetime"><?php print $submitted; ?></p>
127
    </footer>
128
  <?php endif; ?>
129

    
130
  <div<?php print $content_attributes; ?>>
131
    <?php print render($content); ?>
132
  </div>
133

    
134
  <?php if ($links = render($content['links'])): ?>
135
    <nav<?php print $links_attributes; ?>><?php print $links; ?></nav>
136
  <?php endif; ?>
137

    
138
  <?php print render($content['comments']); ?>
139

    
140
  <?php print render($title_suffix); ?>
141
</article>