Closed (fixed)
Project:
Zen
Version:
6.x-1.0-beta3
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2009 at 17:28 UTC
Updated:
20 Dec 2010 at 15:55 UTC
Hi,
Zen provides a search box that can be enabled or disabled.
In Drupal bock configuration, it's possible to add a different search box to a block.
Why two search boxes?
And how to put zen's search box in a different block than navbar?
Comments
Comment #1
crutch commentedI moved the theme search code to the header area by moving the snippet of code that displays the theme search box and putting in the zone I wanted it and then specifically positioned with CSS.
the portion I moved
and then modified this line by removing $search_box from the "if" "or" statement.
and place the search code here
and then modified my fixed-layout.css here
Everything seems to work fine and it looks like it is part of the header.
What I will probably do now is customize the button and input box but I have some other stuff to do first, lol.
Comment #2
anrikun commentedThank you for your answer.
Yes I tried the same, but I want the search box in the right side bar, and right side bar's content is in the variable $right.
So I have created a custom block and assigned it to right side bar.
Now I would like to write a snippet inside this custom block to render the search box but copying pasting
doesn't work as $search_box is a template var not available from within a block snippet.
Obviously I'm doing it the wrong way (I'm still a newbie!): I don't know how to have the search box rendered from a block snippet.
If someone can help me...
Comment #3
crutch commentedO, I see. What I've done for that is edit the search.module
Make sure to make a copy to text file so you can quickly revert back if needed.
Comment #4
anrikun commentedYou mean that you directly edited the core file?
I would like to override it inside my theme without editing the core file directly. But I don't know how yet: I'm still learning!
I'm a bit lost with hooks, themes, etc. :-D
Comment #5
crutch commented10-4 I just do the core file. It is a small change and easy to update but I'd like to know how also.
Comment #6
lvthunder commentedI would like to know the best way to do this too. I need to alter it so it searches a third party module by default.
Comment #7
anrikun commentedFirst of all you should look at the search module in /modules/search/ to see how it works.
Then you could alter the search form by providing an implementation of hook_form_alter() in a custom module.
Comment #8
lvthunder commentedSo I need to create a new module just to change the post action of search to go from /search/node to /search/gallery? Do you know of any examples I can use? I only know enough PHP to be able to edit the .tpl.php files.
Comment #9
anrikun commentedWhat is the gallery module you're using?
Comment #10
lvthunder commentedIt's a photo management software. http://gallery.menalto.com. It uses the gallery module http://www.drupal.org/project/gallery. You can see what I'm trying to build at http://test.lvthunder.com. I have a block that makes search work the way I want it to, but I would like the zen search bar to do the same. That way I can take the search block out of the left sidebar.
Comment #11
anrikun commentedDo you really have to use zen search box then?
If the search box your site is using works, why don't you just modify you theme so that the box is not displayed in left sidebar but somewhere else?
If you need more help please post your theme's files.
Comment #12
lvthunder commentedWell I guess not. I just thought it would be easier to modify the zen one, but I guess I'm mistaken. Thanks for your help anrikun.
Comment #13
farez commentedYou need to enable the search box by going into your theme config and then checking the 'Search box' checkbox. You'll then have the $search_box variable in your template file for the search box.
Farez
Comment #14
dgautsch commentedEDIT: Nvm, i solved my own issue.
I can't get my search box to appear on my sub theme. I checked the .info file and it is indeed enabled. But when I go to the theme config in Drupal the box is ghosted out. Is there any reason for this?
Comment #15
sethwilpan commentedIs the Search module enabled in Site Building/modules?
Comment #16
sh264 commented@sethwilpan: 2 different search options here.
yeh, enable the search module in yoursite.com/admin/build/modules
do your permissions or whatever
then stick your "Search form" block in a region: yoursite.com/admin/build/block
zen search is done through the theme, as above by ferez in #13: yoursite.com/admin/build/themes
then configure your theme, check the search box, save and style
sure you've figured it out by now.
Comment #17
kbk commented@ #2 : Don't know if this helps but my "additional-search-box-in-a-block" problems were solved when I happened over here: http://drupal.org/node/611942
Comment #18
akalata commentedComment #20
sammyman commentedHow do you accomplish this with drupal 7?
Comment #21
kbk commentedThis issue is closed (and marked for D6.) You should probably open a new issue for your Drupal 7 question.