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

这里的技术是共享的

You are here

lisa 蓝雨露 模板文件 变量 中文注释 node-album.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.)
 * - $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()
 */
?>
<?php global $base_url; ?>
<?php if ($teaser): ?>
<?php /*<!-- 摘要页面 -->*/ ?>
  <div class="list albumList<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> ">
    <?php print $node->field_photos[0]['view']; ?>
    <div class="hide">
    <h2>
    <em><?php print drupal_substr($node->field_photos[0]['data']['title'], 0, 20); ?>@</em>
    <a href="<?php print $base_url . "/" . $node->path ;?>" title="<?php print $node->title ; ?>"><?php print drupal_substr($node->title, 0, 30); ?></a>
    </h2>
    <p class="count"><?php print $node->links['statistics_counter']['title'] ; ?>  <a href="<?php print $base_url . "/" . $node->path . "#comments" ;?>"><span class="comment"><?php print $comment_count; ?>次评论</span></a></p>
    <div class="tid"><?php print $terms ?></div>
    </div>
  </div>
<?php /*<!-- /摘要页面 -->*/ ?>
<?php endif;?>
 
 
<?php if ($page): ?>
<?php /*<!-- 完整节点页面 -->*/?>
<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 if ($node->content['body']['#value']):?>
    <div class="node-body">
    <?php print $node->content['body']['#value'] ?>
    </div>
  <?php endif ;?>
  
  
  <div class="node-photos">
 
  <?php if($node->content['field_photos']['field']['#label_display'] != 'hidden'):?>
    <h3 class="field-label"><?php print $node->content['field_photos']['field']['#title'] ;?></h3>
  <?php endif;?>
 
  <?php foreach ((array)$node->field_photos as $item) { ?>
      <div class="photo-item">
      <?php print $item['view'] ?>
      <?php if ($item['data']['title']): ?>
      <h4 class="hide"><?php print $item['data']['title']?></h4>
      <?php endif;?>
      </div>
  <?php } ?>
 
  </div>
  
  </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>
<?php /*<!-- /完整节点页面 -->*/ ?>
<?php endif;?>
 
 
 
 
 
 
普通分类: