Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / modifying the search form

modifying the search form

Locked

Views: 2,264

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
21 Jan 2008, 6:17 AM
#1
tonkali avatar

tonkali

New Zenner

Join Date:
Sep 2006
Location:
NYC
Posts:
76
Plugin Contributions:
0

modifying the search form

hello,

ideally, i would like the search feature that is in the leftBoxContainer to look like this and I am trying to accomplish this or something close to it.

can someone tell me how to modify this

  if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
    $content .=  zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON). ' ' . zen_draw_input_field('keyword', '', 'size="6" maxlength="50" style="width: 

100px;border:0px" 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 . '\';"');
  } else {
    $content .= ' <input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />' .' ' . 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 . '\';"');
  }
``` from the tpl_search_header.php file.

I would like it state *USE_CSS_BUTTONS* regardless so i don't need the if statement.
21 Jan 2008, 7:09 AM
#2
kobra avatar

kobra

Black Belt

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

Re: modifying the search form

I think that tpl_search_header.php file is the wrong file

i would like the search feature that is in the leftBoxContainer
Try a copy of includes/templates/template_default/sideboxes/tpl_search.php

21 Jan 2008, 7:44 AM
#3
tonkali avatar

tonkali

New Zenner

Join Date:
Sep 2006
Location:
NYC
Posts:
76
Plugin Contributions:
0

Re: modifying the search form

hi kobra,

you're right, i modified the tpl_search_header.php instead (the sites a wreck at the moment but take a looksee for better understanding.

I want to get rid of the search at the top header (will have to mod that). The only search object I want is on the left.

Below is the

  $content = "";
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
  $content .= zen_draw_form('quick_find', 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="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>';
  } 

from tpl_search.php which I thought was connected to having the advance search in the leftBoxContainer not the basic search? So how do I get it to USE_CSS_BUTTONS regardless?

thanks for the help and looksee.

21 Jan 2008, 7:51 AM
#4
kobra avatar

kobra

Black Belt

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

Re: modifying the search form

I want to get rid of the search at the top header (will have to mod that). The only search object I want is on the left.
No need to mod

admin > tools > layout boxes controller > sideboxes/search_header.php > turn off

21 Jan 2008, 8:03 AM
#5
tonkali avatar

tonkali

New Zenner

Join Date:
Sep 2006
Location:
NYC
Posts:
76
Plugin Contributions:
0

Re: modifying the search form

from Admin Tools there are 2 search feature boxes:

  1. sideboxes/search_header.php (which turns on the basic search feature at the header and leftBoxContainer; and

  2. sideboxes/search.php which turns on the search with an 'Advanced Search' link (on the left or right side).

I do not want the second option, I want the first but when I turn it off it turns them both off which is why I stated I'd have to mod the header. Am I missing something?

anything on how to mod the tpl_search_header.php so it will USE_CSS_BUTTONS regardless?

many thanks!!

21 Jan 2008, 8:21 AM
#6
kobra avatar

kobra

Black Belt

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

Re: modifying the search form

admin > config > layout settings > css bottons > yes

CSS Buttons
Use CSS buttons instead of images (GIF/JPG)?
Button styles must be configured in the stylesheet if you enable this option.
comment out in /common/tpl_header.php

<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
21 Jan 2008, 8:31 AM
#7
tonkali avatar

tonkali

New Zenner

Join Date:
Sep 2006
Location:
NYC
Posts:
76
Plugin Contributions:
0

Re: modifying the search form

yes, the css buttons 'where' turned on in Admin > Layout Settings but they made all buttons (cart, reviews, etc.) css and I only want css control over that particular portion of that leftBoxContainer, which from what i can discern is the tpl_search_header.php file.

I have been back and forth with form tags or css to get this styled the way previously posted. This site will be heavily modded, I have mucho work to do. I have secured it (yet to .htaccess), and have the proper template override system :)

thanks so much for your help, my puter's bout to possibly crash and i need to reboot but will be back in 5 min to comment out in /common/tpl_header.php :)

21 Jan 2008, 9:35 AM
#8
tonkali avatar

tonkali

New Zenner

Join Date:
Sep 2006
Location:
NYC
Posts:
76
Plugin Contributions:
0

Re: modifying the search form

mucho thanks Kobra! the comment out was perfect! any ideas on the css styling? :)

thank U!

24 Jan 2008, 7:57 PM
#9
tonkali avatar

tonkali

New Zenner

Join Date:
Sep 2006
Location:
NYC
Posts:
76
Plugin Contributions:
0

Re: modifying the search form

I'm bumping this so as not to start a new post

ideally, i would like the search feature that is in the leftBoxContainer to look like this http://www.zuna-media.com/cls/images/ (the image at the bottom), and I am trying to accomplish this or something close to it.

can someone tell me how to modify this

 if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
    $content .=  zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON). ' ' . zen_draw_input_field('keyword', '', 'size="6" maxlength="50" style="width: 

100px;border:0px" 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 . '\';"');
  } else {
    $content .= ' <input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />' .' ' . 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 . '\';"');
  }

from the** tpl_search_header.php file to state it to USE_CSS_BUTTONS regardless, i do not need the if statement.**

I only want css to be turned on for the search button.

If I have access to this feature I can then use an image for the background and style out the submit and textarea.

many thanks!