I have migrated a site from Drupal 6 to Drupal 7. I have rendered the search form in page.tpl.php as follows:

     $block = module_invoke('search','block_view','form');          
     print render($block['content']); 

I am able to search, but pagination is missing in the search result page.

In the theme folder I have search-results.tpl.php and search-results.tpl.php.

In the search-results.tpl.php <?php print $pager; ?> is available.

If I change theme to default theme or core theme pagination is working fine.

What is the issue over here which is causing not showing pagination links?

  • how many items must be displayed in pager settings and how many items are showed in your search result?
    – xurshid29
    Dec 13, 2013 at 7:45
  • By default its ten.Its showing ten, but not showing pagination links.
    – Ram
    Dec 13, 2013 at 7:58
  • Are the result items more then ten?
    – xurshid29
    Dec 13, 2013 at 8:17
  • Yes there are more then ten
    – Ram
    Dec 13, 2013 at 8:20
  • may be something went wrong when you migrated from v6... You can also create your own search by views module.
    – xurshid29
    Dec 13, 2013 at 8:27

1 Answer 1


i don't think that this will help you but do it like this:

// template.php
function MYTHEME_preprocess_page(&$variables){
  $search_box = drupal_render(drupal_get_form('search_form'));
  $variables['search_box'] = $search_box;


<?php print $search_box; ?>

according to this discussion. You should not put your logic into tpl.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.