Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Remove (not turn off) Search Header Field

Remove (not turn off) Search Header Field

Views: 5,982

Results 1 to 17 of 17
6 Jun 2008, 2:28 AM
#1
dbb1 avatar

dbb1

Zen Follower

Join Date:
Jan 2008
Posts:
139
Plugin Contributions:
0

Remove (not turn off) Search Header Field

Hello, Zenners!

I have searched and searched through all the posts but cannot find out how to actually remove the search text box and button from the very top of the header.
Most posts deal with simply being able to turn it off using the admin tools, but I want to remove the search entry field and button so that the header bar actually remains in place. I want to do this for two reasons:

  • aesthetics (my site simply looks better with the top header bar intact), and
  • I like the search box (with link to advanced search) in the side box, and I think it looks funny with two search fields per page.

I've toyed with the tpl_header in both the includes/templates/template_default/common and includes/templates/my-template/common folders, but to no avail. Posts to the template forum (Silverfish) yielded no results.

It would also be an acceptable solution to get the side box search with advanced search link in the header bar, as long as I could still remove it from the side box.

Anyone have any ideas?

Thanks in advance for any help you guys can offer!

6 Jun 2008, 4:51 AM
#2
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

Re: Remove (not turn off) Search Header Field

Did you already try Admin Panel -> Tools -> Layout Boxes Controller -> sideboxes/search_header.php

6 Jun 2008, 2:55 PM
#3
dbb1 avatar

dbb1

Zen Follower

Join Date:
Jan 2008
Posts:
139
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

webskipper:

Did you already try Admin Panel -> Tools -> Layout Boxes Controller -> sideboxes/search_header.php

Thanks for replying, Webskipper. However, if you re-read the post, you'll find that I want to leave the actual header bar in place; I just want to remove the search text box and accompanying button:

"Most posts deal with simply being able to turn it off using the admin tools, but I want to remove the search entry field and button so that the header bar actually remains in place.."

Using the admin tools totally turns off the entire header bar (the dark blue horizontal area in which the the search box and button resides):

10 Jun 2008, 12:05 AM
#4
dbb1 avatar

dbb1

Zen Follower

Join Date:
Jan 2008
Posts:
139
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

DBB1:

Thanks for replying, Webskipper. However, if you re-read the post, you'll find that I want to leave the actual header bar in place; I just want to remove the search text box and accompanying button:

"Most posts deal with simply being able to turn it off using the admin tools, but I want to remove the search entry field and button so that the header bar actually remains in place.."

Using the admin tools totally turns off the entire header bar (the dark blue horizontal area in which the the search box and button resides):

No takers? I would have thought someone would have known how to do this...

Regards

10 Jun 2008, 1:27 AM
#5
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

No problem...... been hacking away.

the name or your shop>includes>templates>the name of your template>common>tpl_header.php and then around line 63:
Remove this code.

<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>

10 Jun 2008, 4:58 AM
#6
dbb1 avatar

dbb1

Zen Follower

Join Date:
Jan 2008
Posts:
139
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

usernamenone:

No problem...... been hacking away.

the name or your shop>includes>templates>the name of your template>common>tpl_header.php and then around line 63:
Remove this code.

<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>

Thanks, Usernamenone. Unfortunately, I've tried commenting out several lines within the navMainSearch block, with varying results. Commenting out the entire line as you have it throws the entire page out of kilter, while commenting out an addional <div> block has the same effect as simply turning off the header bar from within the admin controls.

Looking at the tpl_header file that came with the Zen distribution reveals that my template author totally re-worked this particular section (the statement you mention occurs around line 43 for me). I had posed this question in that forum some time back with no luck resolving it, so there must be some major differences for the author to decide not to tackle my problem. I don't know how common this kind of thing is with template creation, but I am now wondering how much other (seemingly base) functionality make have gotten whacked in this thing.

I'm not much of a php developer, but I guess I'm going to have to try to merge the two files to see if I can get it where I want it to be.

Thanks again for the assist!

10 Jun 2008, 5:52 AM
#7
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

That chunk of code need to be removed and not commented out. hand the code of your header over to me and I will fix it for you.

11 Jun 2008, 2:10 AM
#8
dbb1 avatar

dbb1

Zen Follower

Join Date:
Jan 2008
Posts:
139
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

usernamenone:

That chunk of code need to be removed and not commented out. hand the code of your header over to me and I will fix it for you.

Jeez thanks, Usernamenone! Very generous of you, indeed! The Silverfish tpl_header file is attached (as a .txt extension).

I have tried totally removing the statements you mentioned, but that only served to remove the top header bar completely.

Thanks, again!

11 Jun 2008, 5:36 AM
#9
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

remove line 42-46

<div id="navMainSearch"> <div id="searchBox"> <?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?> </div> </div>

you can replace the search box with text by this

<div id="navMainSearch"> <div id="searchBox"> <p>Welcome to our site!</p> </div> </div>
11 Jun 2008, 6:15 AM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Remove (not turn off) Search Header Field

Two lines in your stylesheet will take care of this without touching any php files. Find in your main stylesheet```
#navMainSearch {
width: 100%;
background-color: #1D5685;
/*
background-image: url(http://images.ciao.com/ide/images/tabs/bg_search_40px.gif);
*/
float: right;
}

#searchBox {
float: right;
}

height: 21px;
to
#navMainSearch
and change
float: right;
to
display: none;
in #searchBox:

#navMainSearch {
width: 100%;
background-color: #1D5685;
float: right;
height: 21px;
}

#searchBox {
display: none;
}

11 Jun 2008, 5:46 PM
#11
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

DBB1:

Hello, Zenners!

I have searched and searched through all the posts but cannot find out how to actually remove the search text box and button from the very top of the header.
Most posts deal with simply being able to turn it off using the admin tools, but I want to remove the search entry field and button so that the header bar actually remains in place.

Thanks in advance for any help you guys can offer!

Look at post 1 and see that the poster wanted the code removed and not just turned offfffffffff.

12 Jun 2008, 4:15 AM
#12
dbb1 avatar

dbb1

Zen Follower

Join Date:
Jan 2008
Posts:
139
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

usernamenone:

remove line 42-46

<div id="navMainSearch"> <div id="searchBox"> <?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?> </div> </div>

you can replace the search box with text by this

<div id="navMainSearch"> <div id="searchBox"> <p>Welcome to our site!</p> </div> </div>

gjh42:

Two lines in your stylesheet will take care of this without touching any php files. Find in your main stylesheet```
#navMainSearch {
width: 100%;
background-color: #1D5685;
/*
background-image: url(http://images.ciao.com/ide/images/tabs/bg_search_40px.gif);
*/
float: right;
}

#searchBox {
float: right;
}

> height: 21px;
> to
> #navMainSearch
> and change
> float: right;
> to
> display: none;
> in #searchBox:
> ```
#navMainSearch {
	width: 100%; 
	background-color: #1D5685;
	float: right;
	height: 21px;
	}
	
#searchBox {
	display: none;
	}

:clap: Thanks so much to both of you! I've been looking for a solution to this problem off and on for more than a month, then WHAM! Two working solutions in one day!

Each one of your suggestions gives me additional possibilities outside of my original request that I hadn't considered before.

Thanks again!

18 May 2010, 9:20 AM
#13
sushigal avatar

sushigal

Zen Follower

Join Date:
Mar 2009
Posts:
435
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

I am trying to do this but putting that bit of code in does nothing, I only have #navMainSearch {
float: right;
}

in my stylesheet but if I change the float right bit to display none it does nothing also. my site is at; http://www.thegreatgiftshop.co.uk/zencart

18 May 2010, 9:21 AM
#14
sushigal avatar

sushigal

Zen Follower

Join Date:
Mar 2009
Posts:
435
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

doh, was editing the wrong stylesheet. Done and it worked! :)

18 Nov 2011, 7:12 AM
#15
atfzc avatar

atfzc

New Zenner

Join Date:
Nov 2011
Posts:
22
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

I want to do the same thing, but I don't see that code in my main style sheet. I'm using and imported template so maybe that is why I'm not seeing it. Here is where I think I need to make a change, but I don't know what to change. Or I could just be way off.

#navMainSearch, #navCategoryIcon, .buttonRow, #indexProductListCatDescription {
/margin: 0.5em;/
}

#navBreadCrumb {
background-color: #333;
padding: 3px;
border: 1px solid #222;
}

#navEZPagesTop {
background-color: #444;
padding: 0.5em;
border-top: 1px solid #222;
}

#navColumnOne, #navColumnTwo {
background-color: transparent;
}
code {
/font-family: arial, verdana, helvetica, sans-serif;/
}

form, select {
display: inline;
margin: 0.1em;
}

textarea {
margin: auto;
padding: 0 3px;
width: 100%;
background-color: #555;
border: 1px solid #222;
color: #fff;
font: inherit;
}
fieldset {
padding: 0.5em;
margin: 0.5em 0em;
border: 1px solid #222;
}

legend {
font-weight: bold;
padding: 0.3em;
}

label, h4.optionName {
line-height: 1.5em;
padding: 0.2em;
}

label.checkboxLabel, label.radioButtonLabel {
margin: 0.5em 0.3em;
}

18 Nov 2011, 7:34 AM
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Remove (not turn off) Search Header Field

Try adding the rules mentioned in post 10 to your stylesheet. If that doesn't work, we can advise correctly by looking at your site live.

23 Dec 2011, 9:11 PM
#17
kobra8 avatar

kobra8

Zen Follower

Join Date:
Mar 2009
Location:
Serbia
Posts:
350
Plugin Contributions:
0

Re: Remove (not turn off) Search Header Field

Hi I have put code in stylesheet.css

#navMainSearch {
width: 100%;
background-color: #1D5685;
float: right;
height: 21px;
}

#searchBox {
display: none;
}

Byt noting hapend!!!
shop: http://prirodni-lek.kavanali.com/zencart/

Please help :blush: