I have my search environment set up, works great, delivers just the results I expect. My only issue is I just want users to use the Enviroment to search one specific cck field. I would like to disable the Anywhere keyword search.
If possible, I would also like to remove the "More Options" on the search environment block, take out the drop down options on the search environment page, and maybe even change the text on the "Search" button. Basically, for this particular site, strip the users' search options way down.
It says here that this may be possible with hook_form_alter(), but although I have been checking out the module code and reading the api docs, I still have no idea where to begin. If someone could nudge me in the right direction, that would be awesome.
Comments
Comment #1
drpl[env] is the environment id you created, don't forgive to change it in all code below
In template.php
and after that make theme file called faceted_search_ui_form_[env].tpl.php
Abdulla
bamlhs@hotmail.com
Comment #2
jenna.tollersonWell, I must be doing this wrong, because it doesn't seem to have any effect. Here's my code in template.php:
Then of course I have a file called faceted_search_ui_form_2.tpl.php with the text specified above. But when I go look at my search page or block, everything is exactly the same. Am I implementing this right?
Comment #3
drplI was tested my code above and it work so fine
you have first at all run corn, and go to admin/build/themes
i hope it's work with u
Comment #4
jenna.tollersonWhich version of the module are you using?
Comment #5
drpl6.x-1.x-dev
Comment #6
jenna.tollersonThat must be why the code isn't working for me. I'm using 5.x-1.0-beta4. Hmmm. I wonder if there is a way to backport this.
Comment #7
jenna.tollersonSo I figured out what I needed to do, and it was definitely to use hook_form_alter(). I think this solution is very specific to my case, but I'm posting this here in case it is helpful to someone else.
I was helped by a short tutorial on hook_form_alter() here on Ubercart.org forums, which cleared up for me exactly what I'm supposed to do with that function. I created a small module called rrforms, and in rrforms.module I used this code:
This is probably kind of hacky but it gave me what I wanted. I did put the following code in my template.php to change the fieldset legend on the search enviroment page, but this was the only change to my theme.
Comment #9
robmil29 commentedAfter applying the code in #1 my block is themed how it should be. However, now when I click submit it takes me back to the home page. The same thing goes for the 'more options' link. Does anyone know why this might be? I have the code copied exactly as is.