If this is your first visit, check our documentation. To post, register or login.

Header Search Issue.

Locked

Started by adem_i on 26 Aug 2010, 4:30 PM · Views: 2,595

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
26 Aug 2010, 4:30 PM
#1
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Header Search Issue.

I'd like to achieve the following search bar layout. You'll notice it's centered in the logo banner area.

%%BBCODE_CODE_0%%

and this is what I currently have
https://www.qnecomputing.com.au

I've been stuck on this for days. Someone please help

relatively new to Zen Cart

26 Aug 2010, 5:44 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Header Search Issue.

Following link - looks like you got it centered

Zen-Venom Get Bitten

27 Aug 2010, 1:11 AM
#3
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Re: Header Search Issue.

When I maximise the page, the left hand side of the frame behind the search bar goes over the logo.

%%BBCODE_CODE_0%%

I didn't create a new class for the search bar, it's the one that's ment to be located in the top right hand corner of the page. Would it be better to create a new class to put the search bar in? If so, how can I achieve this. If not, how can I just fix the positioning problem with the search bar.

Also, where can I change the size properties of the search bar?

relatively new to Zen Cart

27 Aug 2010, 1:17 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Header Search Issue.

There is a div ID for it that you can add positioning to as css in the stylesheet(add the tag if it does ot exist)

id=headerSearch which is #headerSearch

Zen-Venom Get Bitten

27 Aug 2010, 1:33 AM
#5
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Re: Header Search Issue.

This is what I currently have in #headerSearch

#headerSearch {

background-color: #B7CEE8; 
text-align: right;
width: 33%;
padding-right: 20px;
position:absolute;
top: 6em;
left:30em;
border:1px solid; #c0c0c0

}

When I increase the width, the light blue frame behind the search box increases but not the search box itself...

relatively new to Zen Cart

27 Aug 2010, 7:53 AM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Header Search Issue.

where can I change the size properties of the search bar?
In a copy of template_default/sideboxes/tpl_search.php for your template structure overrides
Find and I am fairly certian that the highlighted values are what you can adjust

  if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
    $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px"') . '<br />' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
    $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';
  } else {
    $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . '<br /><input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 50px" />';
    $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';

Zen-Venom Get Bitten

27 Aug 2010, 2:17 PM
#7
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Re: Header Search Issue.

I tried changing the values in tpl_search.php and nothing happened.

relatively new to Zen Cart

27 Aug 2010, 2:55 PM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Header Search Issue.

I tried changing the values in tpl_search.php and nothing happened.
Sorry, wrong file - - discard changes to tpl_search.php and instead get a copy of the file tpl_search_header.php

Chenge where the value is 100 & highlighted in 2 places

  if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
    $content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 100px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . ' ' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
  } else {
    $content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 100px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . ' <input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />';
  }

Zen-Venom Get Bitten

27 Aug 2010, 3:38 PM
#9
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Re: Header Search Issue.

Thanks!!

however I still have a problem with the positioning. I'm trying to make it so as I change the size of the webpage, it'll always stay in the middle of the logo.

#headerSearch {
background-color: #050598;
text-align: center;
width: 470px;
padding-right: 1px;
position: absolute;
top: 6em;
left:25%;
}

Also, Is it possible to change the height of the search bar? I tried a few things but neither worked

style="width: 100px" "height: x"
style="width: 100px, height: x"

where x = any real integer (px)

relatively new to Zen Cart

28 Aug 2010, 3:25 AM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Header Search Issue.

Was it you that placed this in a table versus the default div?

Standard code has this as a div - - #navMainSearch

Zen-Venom Get Bitten

28 Aug 2010, 7:08 PM
#11
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Re: Header Search Issue.

No it wasn't me. I purchased the template solution (slightly modified) from another company which I am now somewhat regretting. It was when I was new to everything and had no idea bout the open source Zen Cart.

How would I go about creating a search bar in default div if it doesn't already exist?

In my stylesheet.css, I currently have

#navMainSearch {

float: right;

}

Does this mean it already exists just not enabled? If so, how would I enable it?

relatively new to Zen Cart

29 Aug 2010, 1:28 AM
#12
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Header Search Issue.

Does this mean it already exists just not enabled? If so, how would I enable it?
It exists but not in your template because the code has been altered

you might look in your template's /common folder for a tpl_header.php and compare it to the one in /template_default/common

Zen-Venom Get Bitten

29 Aug 2010, 7:57 AM
#13
lissae avatar

lissae

Totally Zenned

Join Date:
Oct 2007
Location:
Australia
Posts:
814
Plugin Contributions:
0

Re: Header Search Issue.

The search has an absolute position in the declaration...add a relative position to an outer div...

Try adding position:relative; to your #mainWrapper declaration in the stylesheet

Hope that helps :)

HunnyBee Design
"A man's manners are a mirror in which he shows his portrait." ~ Johann Wolfgang von Goethe

30 Aug 2010, 2:50 PM
#14
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Re: Header Search Issue.

I've looked in my template's common folder however my knowledge of coding isn't sufficient enough to really understand how to enable a search bar in #navMain

I tried changing the position to relative but that restricts it to the right of the #headerSearch frame

relatively new to Zen Cart

30 Aug 2010, 2:56 PM
#15
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Header Search Issue.

my knowledge of coding isn't sufficient enough to really understand how to enable a search bar in #navMain
No Need

admin > tools > layout sidebox controller > look for "sideboxes/search_header.php" > and turn it on

Zen-Venom Get Bitten

30 Aug 2010, 3:14 PM
#16
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Re: Header Search Issue.

Sorry, I mistakenly thought the position:relative; command was ment to go into #headerSearch. I applied it to MainWrapper and it works now.

Thanks heaps guys

relatively new to Zen Cart

30 Aug 2010, 4:43 PM
#17
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Re: Header Search Issue.

How would I be able to increase the height of the search bar? I've looked through tpl_search_header.php but couldn't find any properties regarding height...

Also, how can I reduce the space from the right side of the search bar to the left side of the search box. From this;
[IMG]http://img15.imageshack.us/img15/5558/69393886.jpg[/IMG]

To this;
[IMG]http://img163.imageshack.us/img163/5233/29566848.jpg[/IMG]

I've tried changing different properties in #headerSearch but haven't had any luck.

relatively new to Zen Cart

30 Aug 2010, 4:47 PM
#18
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Header Search Issue.

how can I reduce the space from the right side of the search bar to the left side of the search box. From this;
We went through this back in my posting #8

Zen-Venom Get Bitten

1 Sep 2010, 12:16 PM
#19
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Re: Header Search Issue.

I know we discussed changing the width in #headerSearch and in tpl_search_header.php
HEADER_SEARCH_BUTTON . '" style="width: 45px" />';

But whenever I do reduce the size, this is what happens
[IMG]http://img4.imageshack.us/img4/3614/increasesearchbox.jpg[/IMG]

How can I achieve the result in the image I displayed in the above post?

Also, where in #tpl_search_header.php can I link my own search button?

<?php /** * Side Box Template * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_search_header.php 4142 2006-08-15 04:32:54Z drbyte $ */ $content = ""; $content .= zen_draw_form('quick_find_header', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'); $content .= zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT); $content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id(); if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') { $content .= zen_draw_input_field('keyword', '', 'size="8" maxlength="30" width="400" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . ' ' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON); } else { $content .= zen_draw_input_field('keyword', '', 'size="8" maxlength="30" style="width: 400px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . ' <input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />'; } $content .= "</form>"; ?>

relatively new to Zen Cart

1 Sep 2010, 1:09 PM
#20
adem_i avatar

adem_i

New Zenner

Join Date:
Jul 2010
Location:
Sydney, Australia
Posts:
86
Plugin Contributions:
0

Re: Header Search Issue.

Sorry, accidentally highlighted in yellow.

relatively new to Zen Cart