At http://drupal.org/node/11812, the search box does not work in the default page.tpl.php. It should be "edit[keys]" instead of just "keys" in the text box. This applies to 4.6 at least.

      <input class="form-text" type="text" size="15" value="" name="keys" /><input class="form-submit" type="submit" value=" <?php print t("Search")?> " />

Comments

killes@www.drop.org’s picture

Status: Active » Fixed

fixed

Anonymous’s picture

Status: Fixed » Closed (fixed)
bradlis7’s picture

Status: Closed (fixed) » Active

When I load up the page up, it still seems to be wrong. Here's the exact text:

<input class="form-text" type="text" size="15" value="" name="keys" /><input class="form-submit" type="submit" value="<?php print t("Search")?>" />

But in the text field, ' name="keys" ', should be ' name="edit[keys]" '. Sorry if I wasn't clear the first time.

bradlis7’s picture

Here's an easier way to do it, which is how I did it in my theme, B7.

  <?php if ($search_box): ?>
    <div id="search">
      <?php print search_form('','',null,''); ?>
    </div>
  <?php endif; ?> 
bradlis7’s picture

Correction: Instead of

if ($search_box):

endif;

should be

print search_box("search_block_form");

bradlis7’s picture

Sorry, due to the fact that preview doesn't work and carelessness, that wasn't right. I'll try to make it right this time.

It should be:

   <?php if ($search_box): ?>

       <?php print search_box("search_block_form"); ?>

   <?php endif; ?>
bradlis7’s picture

Project: Drupal.org site moderators » Documentation
Component: web site » Developer Guide

Moved to handbook issues.

bradlis7’s picture

I think I may have this right now. search_box() by default is for theme, so it should be something like this:

<?php if ($search_box): ?>
  <?php print search_box("search_block_form"); ?>
<?php endif; ?>
bradlis7’s picture

Sorry, it sure would be nice if preview worked like it's supposed to. Here's the real thing:

<?php if ($search_box): ?>
  <?php print search_box(); ?>
<?php endif; ?>
bradlis7’s picture

Component: Developer Guide » Customization and Theming Guide
Priority: Normal » Critical

I think the page.tpl.php needs some general love to get it up to speed.

It should use search_box() to print the search form, and "echo $scripts" should also be added in. I'm sure there's more, but that's all I know for sure.

add1sun’s picture

Status: Active » Fixed

bunch of things corrected and a new sample put in that is bluemarine's D5 page.tpl.php.

Anonymous’s picture

Status: Fixed » Closed (fixed)