0

I created a custom searchpage.tpl.php to print out search form and search results using the following code:

<div class="searchblock">
<?php
print drupal_get_form('search_form');
?>
</div>

<div class="search-result <?php print $search_zebra; ?>">
  <dt class="title">
    <a href="<?php print $url; ?>"><?php print $title; ?></a>
  </dt>
  <dd>
    <?php if ($snippet) : ?>
    <p class="search-snippet"><?php print $snippet; ?></p>
    <?php endif; ?>
  </dd>
</div>

It shows the search form correctly and when I search a phrase, URL changes to http://domain.com/search/node/phrase But it doesn't show the search results, How can I make it work please?

  • search-api has not any 6 version, and in drupal core search module there is not any searchpage.tpl.php. please check your question, it seams something wrong in it – Mohammad Ali Akbari Oct 11 '12 at 9:39
  • Thanks, but as I mentioned above I CREATED a custom searchpage.tpl.php. anything related to search redirects to this page. – Zim3r Oct 11 '12 at 9:45
1

Here's the solution:

<div class="searchblock">
<?php
print drupal_get_form('search_form');
?>
</div>

<?php
$keys = arg(2);
print search_data($keys, $type = 'node');
?>
</div>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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