Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

1 Answer

up vote 1 down vote accepted

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>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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