开发者

Determine if the current Drupal page is a search results page?

How can I开发者_StackOverflow社区 determine if the current Drupal page is a search results page?


Assuming clean URLs are on, this usually works

function MYTHEME_preprocess_page (&$vars, $hook) {
  // ...  

  if ($hook == 'page' && arg(0) == 'search') {
    // do search related stuff
  }
}

inside your template.php.

Normal template suggestions work, too, such as using a page-search.tpl.php instead of page.tpl.php if that is also needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜