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

这里的技术是共享的

You are here

判断是 详情页面 文章 单页面 还是列表页面 (概要 summary) 有大用 有大大用


在 template.php 的 

if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) {
    $variables['classes_array'][] = 'node-full';
  }
  if(isset($variables['content']['body'][0]['#markup'])  && $variables['teaser']){
    $variables['content']['body'][0]['#markup'] = _strip_only($variables['content']['body'][0]['#markup'], '<img><iframe><embed><br>');
  }



在 node.tpl.php 里面

* Node status variables:    
 * - $view_mode: View mode; for example, "full", "teaser".    
 * - $teaser: Flag for the teaser state (shortcut for $view_mode == 'teaser').    


普通分类: