* * - $title: The title of the node. * - $user_picture: The node author's picture from user-picture.tpl.php. * - $date: Formatted creation date. Preprocess functions can reformat it by * calling format_date() with the desired parameters on the $created variable. * - $name: Themed username of node author output from theme_username(). * - $node_url: Direct url of the current node. * - $submitted: Submission information created from $name and $date during * template_preprocess_node(). Only print this when the $display_submitted * variable is TRUE, since otherwise the site administrator has requested * that it not be displayed. * - $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. * * Some of the most important variables required to theme the node are provided * as renderable arrays (in the "Advanced variables" section below), for * maximum flexibility in the theming layer. For convenience, however, we * define basic variables here based on the way we want to render these arrays * in this particular template file. As above, these all contain HTML-safe * strings which can be printed in the template file using a syntax like * * * - $title_prefix_html: HTML that is populated by modules and intended to be * displayed in front of the main title tag that appears in the template. * (This is a rendered version of the $title_prefix array, which can be found * in the "Advanced variables" section below.) * - $title_suffix_html: HTML that is populated by modules and intended to be * displayed after the main title tag that appears in the template. (This is * a rendered version of the $title_suffix array, which can be found in the * "Advanced variables" section below.) * - $comments_html: HTML containing the comments associated with the node. * - $links_html: HTML containing the links associated with the node, such as a * "Read more" link. * - $content_html: HTML containing the rendered content of the node, excluding * the comments and links. (This and the variables above it are rendered from * the $content array, which can be found in the "Advanced variables" section * below.) * **************** * Boolean flags: **************** * * The following variables can only take on true/false values and are often * used in the template file with a syntax like: * * ... * * to decide whether or not other variables or HTML should be printed. * * - $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. * - $display_submitted: Flag for whether submission information (contained in * the $submitted variable) should be displayed. * - $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. * ********************* * Advanced variables: ********************* * * The following variables contain renderable arrays which can be printed in * the template file using a syntax like . To * print part of the array's content without touching the rest, use a syntax * like . To temporarily suppress * the printing of a given element, use . * * - $content: An array of node items making up the main content of the node. * - $title_prefix: An array containing additional output populated by modules, * intended to be displayed in front of the main title tag that appears in * the template. * - $title_suffix: An array containing additional output populated by modules, * intended to be displayed after the main title tag that appears in the * template. * * For the specific needs of this template file, these variables are rendered * in a particular way, and the resulting HTML strings are stored in new * variables (listed in the "Basic variables" section above) which are then * printed to the template file directly. The PHP code below shows how this is * done and can be modified for more advanced use cases (e.g., if you want to * render the variables differently). * *****************************************************************************/ // PHP code to prepare the variables described above. // This is used for the limited purpose of defining simple, easy-to-print // variables that are specific to this template and derived from the // renderable arrays provided to us. In general, PHP code to add new // variables or for more advanced use cases belongs in a preprocess function // in the theme's template.php file, e.g. bartik_preprocess_node(), rather // than here. $title_prefix_html = render($title_prefix); $title_suffix_html = render($title_suffix); $comments_html = render($content['comments']); // Remove the "Add new comment" link on the teaser page or if the comment // form is being displayed on the same page. if ($teaser || !empty($content['comments']['comment_form'])) { unset($content['links']['comment']['#links']['comment-add']); } $links_html = render($content['links']); $content_html = render($content); /****************************************************************************** * ****************** * Other variables: ****************** * * The following variables are less commonly used. * * - $node: Full node object. Contains data that may not be safe. * - $type: Node type, i.e. story, page, blog, etc. * - $view_mode: The node's view mode, e.g. 'full', 'teaser'... * - $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. * ****************** * Field variables: ****************** * * For each field instance attached to the node a corresponding variable is * defined, e.g. $node->body becomes $body. When needing to access a field's * raw values, developers/themers are strongly encouraged to use these * variables. Otherwise they will have to explicitly specify the desired field * language, e.g. $node->body['en'], thus overriding any language negotiation * rule that was previously applied. * * @see template_preprocess() * @see template_preprocess_node() * @see template_process() */ ?>
> >
>