用户工具

站点工具


drupal:theme:teaser

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
}
?>

参考

drupal/theme/teaser.txt · 最后更改: 2010/08/23 04:28 (外部编辑)