欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

lisa 蓝雨露 模板文件 变量 中文注释 node.tpl.php

<?php
 
/**
 * @file node.tpl.php
 *
 * 节点的主题化输出。
 *
 * 可用变量:
 * - $title: 节点标题(sanitized)。
 * - $content: 节点内容或摘要。原文:Node body or teaser depending on $teaser flag.
 * - $picture: 来自theme_user_picture()的作者头像输出。
 * - $date: 格式化的创建日期(use $created to reformat with format_date())。
 * - $links: 如“阅读全文”、“添加新评论”等等来自from theme_links()的输出。
 * - $name: 来自theme_username()的节点作者用户名的输出。
 * - $node_url: 当前节点的url。
 * - $terms: 来自heme_links()的分类(taxonomy term)链接输出 好像标签 分类等
 * - $submitted: 来自theme_node_submitted()的发表信息输出。
 *
 * 其他变量:
 * - $node: 完整节点对象。包含的数据可能不安全。
 * - $type: 节点类型,例如 story、page、blog等等。
 * - $comment_count: 此节点的评论数。
 * - $uid: 此节点作者的用户ID。
 * - $created: 此节点发表时间(Unix时间戳)。
 * - $zebra: 输出“even”或“odd”。可用于摘要列表的奇偶行样式控制。
 * - $id: Position of the node. Increments each time it's output.
 *
 * 节点状态变量:
 * - $teaser: 摘要标识。(原文:Flag for the teaser state.)
 * - $page: 完整页面标识。(原文:Flag for the full page state.)节点页面就为true 列表页面就是false;
 * - $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.)
 * - $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.)
 *
 * @see template_preprocess()
 * @see template_preprocess_node()
 */
?>
<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clear-block">
 
<?php print $picture ?>
 
<?php if (!$page): ?>
  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>
 
  <?php if ($submitted): ?>
    <div class="meta">
      <?php print $submitted ?>
    </div>
  <?php endif; ?>
  
 
 
  <div class="content">
    <?php print $content ?>
  </div>
 
  <?php if ($terms): ?>
  <div class="terms">
    <?php print $terms ?>
  </div>
  <?php endif;?>
  
  <?php if ($links): ?>
  <div class="links">
    <?php print $links; ?>
  </div>
  <?php endif;?>
</div>
 
 
 
 
 
 
 
普通分类: