Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Changing advanced search window size

Changing advanced search window size

Locked

Views: 939

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
22 Feb 2009, 7:55 AM
#1
susan767 avatar

susan767

New Zenner

Join Date:
Feb 2009
Posts:
23
Plugin Contributions:
0

Changing advanced search window size

Hi,

I tried to look for a thread dealing with this issue but could not find any.

I would like to adjust the size of the search window size as well as From and To input window size in Advanced Search.

Any help on how I can achieve this would be highly appreciated,

Susan

22 Feb 2009, 8:57 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Changing advanced search window size

Not really understanding what you mean by the search window. Normally the advanced search appears on a Zen Cart page like any other page and takes up the space in the center column, do you have your site arranged differently? A link would be helpful.

There are two ways to change the field size. You can either add IDs or classes to the relevant fields in the tpl_advanced_search_default.php template and then add width:nnn stles for those IDs or classes in your stylesheet, or you can add size attributes directly to the input fields in the template (e.g. <input type="text" name="pfrom" /> becomes <input type="text" name="pfrom" size="5" />).

22 Feb 2009, 9:14 AM
#3
susan767 avatar

susan767

New Zenner

Join Date:
Feb 2009
Posts:
23
Plugin Contributions:
0

Re: Changing advanced search window size

kuroi:

Not really understanding what you mean by the search window. Normally the advanced search appears on a Zen Cart page like any other page and takes up the space in the center column, do you have your site arranged differently? A link would be helpful.

There are two ways to change the field size. You can either add IDs or classes to the relevant fields in the tpl_advanced_search_default.php template and then add width:nnn stles for those IDs or classes in your stylesheet, or you can add size attributes directly to the input fields in the template (e.g. <input type="text" name="pfrom" /> becomes <input type="text" name="pfrom" size="5" />).

Thanks for directing me towards the solution. However, I looked into tpl_advanced_search_default.php and the corresponding codes look like this.

<?php echo zen_draw_input_field('keyword', $sData['keyword'], 'onfocus="RemoveFormatString(this, \'' . KEYWORD_FORMAT_STRING . '\')"'); ?>
<?php echo zen_draw_input_field('pfrom', $sData['pfrom']); ?>

All I want to do is simply adjust the physical length of the input field shown on the browser.

Thanks,

Susan

22 Feb 2009, 10:08 AM
#4
susan767 avatar

susan767

New Zenner

Join Date:
Feb 2009
Posts:
23
Plugin Contributions:
0

Re: Changing advanced search window size

susan767:

Thanks for directing me towards the solution. However, I looked into tpl_advanced_search_default.php and the corresponding codes look like this.

<?php echo zen_draw_input_field('keyword', $sData['keyword'], 'onfocus="RemoveFormatString(this, \'' . KEYWORD_FORMAT_STRING . '\')"'); ?>
> 
> ```php
<?php echo zen_draw_input_field('pfrom', $sData['pfrom']); ?>

All I want to do is simply adjust the physical length of the input field shown on the browser.

Thanks,

Susan

This looks like a more complex issue than I had originally thought. After further searching, I found a solution given by DrByte at http://www.zen-cart.com/forum/showthread.php?t=119652&highlight=zen_draw_input_field

So I added the following to my stylesheet:

input[name='keyword'] {width: 250px;}
input[name='pfrom'] {width: 50px;}
input[name='pto'] {width: 50px;}

Although it worked, it was kind of cheating because the sidebox search box, the size of which I did not want to change, also uses the name 'keyword'. Fortunately, the width of that box was fixed at 120px.

I know it gets the job done, but there's gotta be a more intuitive way of doing it. Anyone?

Susan

22 Feb 2009, 11:14 AM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Changing advanced search window size

Apologies. :blush: I must have been thinking of a different version of Zen Cart. The correct answer would have been > <?php echo zen_draw_input_field('pto', $sData['pto'], 'size="5"'); ?>

The attribute selector advocated by DrByte will work in browsers that have fully-implemented the relevant parts of the CSS2 standard. Unfortunately this excludes any version of Internet Explorer up to and including IE6 (which doesn't support it at all) and even version 7 is a bit buggy in this area.

23 Feb 2009, 4:06 AM
#6
susan767 avatar

susan767

New Zenner

Join Date:
Feb 2009
Posts:
23
Plugin Contributions:
0

Re: Changing advanced search window size

kuroi:

Apologies. :blush: I must have been thinking of a different version of Zen Cart. The correct answer would have been

The attribute selector advocated by DrByte will work in browsers that have fully-implemented the relevant parts of the CSS2 standard. Unfortunately this excludes any version of Internet Explorer up to and including IE6 (which doesn't support it at all) and even version 7 is a bit buggy in this area.

Thanks, kuroi

I decided to get in the CSS spirit by adding identifications

<?php echo zen_draw_input_field('keyword', $sData['keyword'], 'id="advancedsearchkeyword"', 'onfocus="RemoveFormatString(this, \'' . KEYWORD_FORMAT_STRING . '\')"'); ?>
<?php echo zen_draw_input_field('pfrom', $sData['pfrom'], 'id="advancedsearchpfrom"'); ?>

and adding in my stylesheet

#advancedsearchkeyword {width: 230px}
#advancedsearchpfrom {width: 50px}

In the process, I found a way to adjust the width of the "Limit to Category" pull-down menu and posted it on a separate thread.

http://www.zen-cart.com/forum/showthread.php?t=120898

Susan