Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default 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" />).
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Changing advanced search window size

    Quote Originally Posted by kuroi View Post
    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 Code:
    <?php echo zen_draw_input_field('keyword'$sData['keyword'], 'onfocus="RemoveFormatString(this, \'' KEYWORD_FORMAT_STRING '\')"'); ?>
    PHP Code:
    <?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

  4. #4
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Changing advanced search window size

    Quote Originally Posted by susan767 View Post
    Thanks for directing me towards the solution. However, I looked into tpl_advanced_search_default.php and the corresponding codes look like this.

    PHP Code:
    <?php echo zen_draw_input_field('keyword'$sData['keyword'], 'onfocus="RemoveFormatString(this, \'' KEYWORD_FORMAT_STRING '\')"'); ?>
    PHP Code:
    <?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/showth...aw_input_field

    So I added the following to my stylesheet:
    Code:
    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

  5. #5
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Changing advanced search window size

    Apologies. 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.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  6. #6
    Join Date
    Feb 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Changing advanced search window size

    Quote Originally Posted by kuroi View Post
    Apologies. 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 Code:
    <?php echo zen_draw_input_field('keyword'$sData['keyword'], 'id="advancedsearchkeyword"''onfocus="RemoveFormatString(this, \'' KEYWORD_FORMAT_STRING '\')"'); ?>
    PHP Code:
    <?php echo zen_draw_input_field('pfrom'$sData['pfrom'], 'id="advancedsearchpfrom"'); ?>
    and adding in my stylesheet
    Code:
    #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

 

 

Similar Threads

  1. Replies: 5
    Last Post: 20 Apr 2010, 12:54 PM
  2. Removing the 'Advanced Search' and changing basic search to title only
    By val-ent in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 30 Aug 2008, 11:39 PM
  3. Is there a way to have advanced search results open the results in a new window?
    By member in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Mar 2008, 08:27 PM
  4. Changing Advanced Search to include ARTIST
    By ginginca in forum Basic Configuration
    Replies: 0
    Last Post: 26 Feb 2007, 02:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg