Hello fellow Drupalers,

I thought it was going to be an easy job after browsing the forums, but guess what? I'm stuck!

I wanted to put the search box in the header region, I tried it first in the Block configuration, it works in the left and right blocks but when I put it in the header region it is not dispalyed. So I tried editing the page.tpl so:

 <!--// display header-->
		{if ($logo || $site_name || $site_slogan)}
			<h1><a href="{$base_path}" title="{$site_name}">
			{if $logo}<img src="{$logo}" alt="{$site_name}" id="logo" />{/if}
			{if $site_name}<div id="site_name">{$site_name}</div>{/if}
			{if $site_slogan}<div id="site_slogan">{$site_slogan}</div>{/if}
			<div id="topsearch"><?php if ($search_box): ?><div id="topsearch"><?php print $search_box ?></div><?php endif; ?>
			</a></h1>
		{/if}

And added this to the style sheet:

#topsearch {float: right
}

But it still doesn't display. Can anybody suggest where I am going wrong? From what I have read this should work, but it doesn't................I'm confused!

Comments

Froggieone’s picture

Hi Ludo1960,
I am not sure why your method did not work.
However, there may be another way out... Please use your browser to visit the admin configuration section in your theme and enable the check box which relates to search form.
Hopefully this will work and you will have a search box in the Header section.

alexrayu’s picture

This will work only with the Search module enabled.
______________________
Alexei Rayu, Web Designer and Developer
SpryDev, Austin TX, Search Engine Marketing
WE GUARANTEE WEB PROFITS
http://www.sprydev.com/design-gallery

ludo1960’s picture

Thanks for your help on this one,

yes the search box is enabled, so whatt do I try next?

alexrayu’s picture

Then it's quite easy - select the "Search form" from the blocks list and set its position to "header"
______________________
Alexei Rayu, Web Designer and Developer
SpryDev, Austin TX, Search Engine Marketing
WE GUARANTEE WEB PROFITS
http://www.sprydev.com/design-gallery

ludo1960’s picture

Yes, that it what I thought!

However It does not display in the header, for some reason or another, in addition when I run (debug} the value of $search_box is "" even though in the database system table it is set to "1"

jdeg’s picture

If you need something like this i can help you.

Sexy Poker Magazine - Banana Tools

jdeg’s picture

Hi, this is what i did:

First af all, i did a new region under the menu and override the search function:

function phptemplate_search_block_form($form) {
  //call the search-block-form.php.tpl
  return _phptemplate_callback('search-block-form', array('form' => $form));
}

and i create the file: search-block-form.php.tpl and fill it with this:

<table>
    <tr>
        <td valign="top">
            <input type="text" maxlength="128" name="search_block_form_keys" id="edit-search_block_form_keys"  size="30" value="" title="Enter the terms you wish to search for." class="form-text" />
        </td>
        <td valign="top">
            <input type="image" src="http://www.sexypokermagazine.com/themes/default/images/bg-button-search.jpg" style="border:0px;" name="op" value="Search"  />
            <input type="hidden" name="form_id" id="edit-search-block-form" value="search_block_form" />
            <input type="hidden" name="form_token" id="a-unique-id" value="<?php print drupal_get_token('search_block_form'); ?>" />
        </td>
    </tr>
</table>

and in the block section i enabled the new region with the Search Form.

and in the css file:

#newRegion h2{
    display: none;
}

so the top of the block disappears.

I hope this information can help you.

Sexy Poker Magazine - Banana Tools

ludo1960’s picture

Many thanks for your considered reply...

Alas I'm using Smarty and not the phptemplate engine!

I've got a funny feeling I'm flogging a dead horse here!

Support for the Smarty theme engine is very thin on the ground, and before you ask, yes I have asked the question on the Smarty forum, but I got banned! Presumably because I asked a Drupal related question there.

Somebody gimme a break please!

Thanks.

alexrayu’s picture

From all this, D6 seems to be more screwed up and complicated. There does not seem to be a reason to complicate this so much as to do ll this Yoga for the sake of a search box. D5 was a candy, and it does seem the guys have made the learning curve even steeper for D6.
You got banned?
______________________
Alexei Rayu, Web Designer and Developer
SpryDev, Austin TX, Search Engine Marketing
WE GUARANTEE WEB PROFITS
http://www.sprydev.com/design-gallery

ludo1960’s picture

Thanks for your reply,

I eventually found the problem after much head scratching, I had enabled the search in the admin but forgot about theme admin section, there's an enable search box option there too! Unbelievable! the double whammy got me! And yes I got banned from the Smarty site for asking a Drupal question, I've got a good word to describe those guys, but I'll leave it to your imagination!

So for anybody else having problems displaying the search box in Drupal 6, check the admin settings and then the theme settings.............easy when you know how!

Thanks again guys,