I have installed the custom search module and the default $search_box is being replaced with the custom search box instead with the tick boxes necessary to search by specific content types. This is exactly what I need.
I have chosen to display the basic search form on the results page so that the user can search again if necessary (but no advanced search option). However, when I do a search, the form on the search results page is the Drupal default that has the label 'enter the keywords' above it and no options to search by content type again (this is on example.com/search and also example.com/search/node/keyword type:content_type).
How can I put the custom search box on /search and /search/node/keyword type:content_type)?
Comment | File | Size | Author |
---|---|---|---|
#7 | categories.png | 58.18 KB | jdanthinne |
Comments
Comment #1
jojo86 CreditAttribution: jojo86 commented*bump* anyone???
Comment #2
jdanthinne CreditAttribution: jdanthinne commentedWhy don't you use advanced search? There you can have the content types selectors, and more…
Comment #3
jojo86 CreditAttribution: jojo86 commentedThe advanced search box has too many options on it. After looking closer into the custom search settings, I can see that I can turn off the OR, And and Negative boxes, as well as reducing the content types. Thanks for suggesting that :)
However, how can I remove the category box and also how can i make the advanced search box show as expanded rather than closed (on the page, you have to click Advanced Search to see the options)?
Comment #4
jojo86 CreditAttribution: jojo86 commentedActually, I have used CSS to remove the category selection box:
.search-advanced .fieldset-wrapper #edit-category-wrapper {
display:none
}
However, I still have the issue of it being collapsed on load and that the search box is displaying the types - I only want it to display their search terms, not the types. I'm going to take a look at the js that controls the advanced search collapsed and expanded states to see if I can add it to my own js files but with my own function.
Comment #5
jojo86 CreditAttribution: jojo86 commentedI have figured it out!
To deal with the expand/collapse issue, I used:
To deal with the content types in the search box issue, I used this in search-results.tpl.php:
Comment #6
jdanthinne CreditAttribution: jdanthinne commentedI'll try to add options in the admin as soon as have some time to do it, so it will be available for everyone, and in a better way (without javascript) ;-)
Comment #7
jdanthinne CreditAttribution: jdanthinne commentedHi, I've just committed changes to the DEV version.
There are now options for a collapsible/collpased advanced search form.
I've also checked for the category selector that should be hidden, and it's working fine. When I uncheck all vocabularies, the category is removed (see screenshot).
BUT as soon as I enable the "Taxonomy translation" module, it seems that the category comes back! I think this is a bug in this other module, not mine, because the category selected displays blank lines where it should display the vocabulary name. I'll have a look at that!
Are you using "Taxonomy translation"?
Comment #8
jdanthinne CreditAttribution: jdanthinne commentedI confirm that a bug in Taxonomy Translation is causing the malfunction of my module...
See #1010504: in advanced search only one vocabulary shows terms to search on. I'll try to help to find the bug.
Comment #9
jdanthinne CreditAttribution: jdanthinne commentedOk, try my fix here http://drupal.org/node/1010504#comment-4124140 , and then, the unselected vocabularies in the Results page settings will disappear from the advanced search, as it used to without Taxonomy Translation.
Comment #10
heddnI'm taking some liberty but a bug report for D6 from 2010 is probably fixed. If you disagree, please reopen and provide more details.