Drop Down Menu - Taxonomy Categories
| Project: | Views Filter Block |
| Version: | 5.x-1.4 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | nimi |
| Status: | active |
Jump to:
First I"d like to thank you for this wonderful module. It works flawlessly.
I built a custom search block consisting an input box, used for entering the search text, and a drop down list of categories. It works great except for one thing that's been bugging me and I can't seem to find an answer:
In the drop down menu I see a list of my categories and the first default option which is selected shows "-Please Choose-". If I leave this the way it is and enter some text to search then the drupal searches in all of the categories automatically. This is exactly what I want BUT how can I change the sentence "-Please Choose-" into "-All Categories-" (like the search bar on Ebay's site?).
Ok, I know this sounds really easy but I tried a few things and none worked:
1. Edited Taxonomy core module file and switched that exact string with the new one. Ran database update. Cleared cache. - result: no change.
2. Installed String Overrides module and put in the strings to be replaced - result: no change.
I"m really stuck. I have no idea where's the source of the string I need to change.
I am using the following setup:
Xampp local host server
Drupal 5.7
Drigg 1.31
Views 1.6
Views Filter Block 1.4
Views Fast Search 2.0
Voting API 1.6
User Karma 1.8
Tagadelic 1.0
CCK 1.7
Many thanks in advance,
Nimi
| Attachment | Size |
|---|---|
| example1.jpg | 131.53 KB |
| example2.jpg | 130.62 KB |

#1
Possible workaround:
(Mis)use translation function of core localisation.
If u have a EN only project, make an extra custon language, e.g. EN-custom.
"Translate" the string to whatever u want it to be.
This works for a lot (should be all) text praises inside Drupal.
Luck,
Kees
#2
...What bothers me is that i cannot REMOVE this option. If i switch on the "optional" option for an exposed filter, I get to choose:
*Show all
*-Please Choose-
*Option1
*Option2
This is ugly, Whats the difference for a user between "show all" and "-Please Choose-"? Its plain confusing.
In case the taxonomy is set as required to the node submitter (admin), the "-Please Choose-" is changed in "-None Selected-". For the admin this makes perfect sense. For the filter user/site visitor this is again plain confusing, it makes no sense.
Is there a method to gently remove "-Please Choose-" or "-None Selected-" options?
Thanks!
Kees
#3
The "-None Selected-" option is considered as a bug. Go and see http://drupal.org/node/199675 for patch the views_taxonomy.inc file (it worked for me).
But we still have a problem with the option list filters: at the top of the list we have "All" AND "-Please choose-".
If I make a search in my view with the "All" option selected, it works (I do obtain search results).
But if I select the "-Please choose-" option, the search results are broken (no results at all).
First we may consider to find a way so that the "All" option be marked as default. Can't find any help in the search engines.
Another solution would be to quit or mask the "-Please choose-" option that doesn't make sense in a view filter.
The HTML code for the "-Please choose-" option is
<option value="">- Please choose -</option>so we can't mask it with css.
I finally found this thread http://drupal.org/node/180109#comment-665927 that gives one another patch for the same views_taxonomy.inc file.
So at the end with my own combination of these 2 patches I have this code (views_taxonomy.inc, line 243):
else {$form = taxonomy_form($vocabulary->vid, 0, $vocabulary->help);
unset($form['#title']);
unset($form['#description']);
unset($form['#options']['']);
unset($form['#default_value']);
$form['#multiple'] = TRUE;
}
return $form;
}
And it works for me! I have the complete list of my category terms in the views filters, with the "All" options, and without the "-None selected-" nore the "-Please choose-" options.
Don't forget to clear cache after applying the patch, clicking the "Clear views cache" button in the Tools tab of the "admin/build/views/tools" page.
#4
subscribing
#5
Not sure if this module can produce a "Drop Down Select Jump Menu" - direct to page without submit button. Something that can be done manually at http://drupal.org/node/91924.
Would be good if has that option.
#6
subscribing.
will try to check this out and report back.
#7
Thank you Julien!
Works like a charm.
#8
is there a drop-down list menu for taxonomy for drupal 6 ? i cannot find it