README.txt 3.9 KB

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