Skip to Content

Drupal主题:为摘要(teaser)页面制作专门的主题模板

有下面的三种方法可以为摘要页面制作单独的主题:

方法一:

<?php
if ($teaser) { 
  // node is being displayed as a teaser
  // Anything here will show up when the teaser of the post is viewed in your taxonomies or front page
} else { 
  //all other cases
  //Anything here will show up when viewing your post at any other time, e.g. previews
}
?>

方法二:

  <?php if ($teaser): ?>
    <!-- teaser template HTML here -->
  <?php else: ?>
    <!-- regular node view template HTML here -->  
  <?php endif; ?>

方法三:

<?php
if ($teaser) { //if node is being displayed as a teaser
  //Anything here will show up when the teaser of the post is viewed in your taxonomies or front page
} elseif ($page) { //if node is being displayed as a full node
  //Anything here will show up when viewing only your post
} else { //all other cases
  //Anything here will show up when viewing your post at any other time
}
?>

参考页面:
http://drupal.org/node/53464

-- EOF-TRUEVUE --

评论

发表新评论

此内容将保密,不会被其他人看见。