Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2011
    Location
    Near Ottawa, Ontario, Canada
    Posts
    321
    Plugin Contributions
    0

    Default Default value in search header

    Hi.

    I'm trying to figure out why the value= I'm entering in languages/english/CUSTOM/header.php isn't showing

    // header Search Button/Box Search Button
    define('HEADER_SEARCH_BUTTON','Search');
    define('HEADER_SEARCH_DEFAULT_TEXT', 'Enter your keywords here');

    Thought it might be hardcoded in includes/templates/CUSTOM/sideboxes/tpl_search_header.php (I'm only concerned with the header search) but it doesn't appear to be.

    $content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 100px" value=Type your keywords to search here"' . 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 . '\';"') . '&nbsp;<input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />';

    any ideas?

    familynowDOTca

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Default value in search header

    Technically, your search box isn't the stock header search that Zencart provides; it's a creation of your Template Monster template, so changing that define might not affect it. Using the Developers Tool kit to search for quick_find_header might point you in the right direction.

  3. #3
    Join Date
    Aug 2011
    Location
    Near Ottawa, Ontario, Canada
    Posts
    321
    Plugin Contributions
    0

    Default Re: Default value in search header

    Thanks for the suggestion. I wouldn't have considered searching for that term. Unfortunately it only pointed me to 4 references within tpl_header and tpl_search_header so no luck there. I'll keep digging...

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Default value in search header

    I had to use Firebug to locate the header search field:) but the visible input field code only contains
    HTML Code:
    <input type="text" name="keyword" class="input1" />
    with no onfocus handling at all. Try searching for something like "input1" and see if you find another file... wherever it is, maybe you can substitute the detailed handling code for the dumb code.

  5. #5
    Join Date
    Aug 2011
    Location
    Near Ottawa, Ontario, Canada
    Posts
    321
    Plugin Contributions
    0

    Default Re: Default value in search header

    Well. I was able to find a way to add a value but it doesn't get cleared onfocus since that function appears to have been removed.

    <span class="corner"></span>
    <?php echo zen_draw_input_field('keyword', 'Enter keywords here', 'class="input1"');?>

    Is there a "simple" way to return to the default ZC header search functions?

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Default value in search header

    You can probably put the stock code in place of the TM code there. You will have to change it a littie to directly echo instead of putting the output into a $content variable.
    PHP Code:
    $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 '\';"') . '&nbsp;<input type="submit" value="' HEADER_SEARCH_BUTTON '" style="width: 45px" />'
    PHP Code:
    <?php echo 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 '\';"') . '&nbsp;<input type="submit" value="' HEADER_SEARCH_BUTTON '" style="width: 45px" />'?>
    I am not certain this is exactly the right snippet to use, as I don't know the context of the file. There is some kind of alternate selection going on in & around the code you posted.

 

 

Similar Threads

  1. Replies: 11
    Last Post: 15 Jan 2015, 05:40 PM
  2. v139h Limit the search default to only search titles and not description
    By amyleew in forum General Questions
    Replies: 6
    Last Post: 31 Dec 2013, 07:22 AM
  3. Delete default search text in search box when clicked
    By jaylyns in forum General Questions
    Replies: 7
    Last Post: 15 Apr 2011, 06:03 AM
  4. Stock default value
    By hosstapio in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 18 Nov 2009, 03:04 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR