开发者

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

开发者 https://www.devze.com 2023-02-04 04:02 出处:网络
How can I开发者_StackOverflow社区 determine if the current Drupal page is a search results page?Assuming clean URLs are on, this usually works

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

精彩评论

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