Is it possible to edit the FACETED SEARCH plugin to reference custom taxonomies instead of categories or tags?
not sure what you mean by custom taxonomies, but you may be able to achieve it using the new exclude categories/tags functionality in Version 3.2
Thanks for replying Andrew. “Custom” taxonomies probably wasn’t the way to phrase it, I simply mean taxonomies that I would create.
So, for example if there were a custom post type of “Cars” there may be different taxonomies such as “Price” “Model” or “Color”. I am looking for a similar functionality of the FACETED SEARCH plugin above (cheers to you on developing the plugin) that uses taxonomies instead of categories or tags.
I haven’t messed with taxonomies other than categories and tags, but one thing you might try is changing the word ‘category’ in lines 40,63, and 141 to the name of your taxonomy, then deactivate and reactivate the plugin and see if you can use the faceted search category widget for your taxonomy. The only problem with this is that you could only use it for one taxonomy at a time. I might need to consider this in a future release- maybe add a dropdown in the widget options to select the taxonomy to display or something; hmm…
Another option is to rebuild your taxonomy as categories, and use different Faceted Search Category widgets for each root category (Price, Model, Color), while excluding the other categories in each of the widgets. You would also want to take advantage of the new disable feature so people don’t search by the word “Price” itself, etc.
Oops, nevermind, I guess option 2 wouldn’t work as different widgets wouldn’t account for each other- they’d have to all be in the same widget, I think…
Hi I have been trying to use your plugin, which is great, however I have issues with the lack of support for taxonomies.
I am trying to use it in conjuction with wp ecommerce. I thought I could use the taxonmy names from wp ecommerce and create a faceted search for my web shop. ie find all products from cat1 that also belong to cat 6.
Problem is actually getting the search to work for this. I have tried your suggestion of changing the word ‘category’ (to wpsc_product_category – the taxonomy name in wp ecommerce). However no result. I also noticed another instance of category on line 492, still no fix though.
Another thing i picked up on was the use of post type. in wp ecommerce the post types used are named wpsc_product, so I tried changing those labels accordingly also and whilst it helped me display the correct list on the widget, the search was broken. Am I missing something?
Also is there a way to eliminate the search button, instead refresh page everytime a box is checked?
Any help will be much appreciated.
One Problem Down, one to go…
Just worked out the Taxonomy issue, I was on the right Path, just missed one of the post-type variables.
But still need some help with the removal of the search button to be replaced by an update each time a box is checked.
Great to hear you’ve solved the harder problem and are left with the easier one! 🙂
Firstly, to remove the buttons themselves, you can remove
<input type="submit" value="Search">from line 528. Then, within the
<input type="checkbox"tags on lines 593 and 597, put something like
And here’s more info on the onclick attribute:
Andrew you are a champ!
however all I had to add was onClick=”submit();
Hi, I don’t understand how resolve taxonomies problem.
The situation is: I have three taxonomies and each of these have more categories.
Thank’s in advance for help.
Hey VisionMedia… I’ve gotten everything to work as you except I’m having that broken search as you were. What are those post type variables that need replacing?
This is exactly what I need help with. I’m sure others as well. Since this plugin is for Categories/Posts, I can’t use it. As I understand it, posts and categories are used for blogging but most of us today use WordPress for much more than that..rather a full CMS. As a result, custom taxonomies ARE the way searching is being handled by blogging expanded and CMS sites, as others have mentioned.
I really think this plugin is a amazing. Since a few of you may have rewritten the code to make this work with taxonomies, could guys please release this in the plug-ins area of WordPress for download? I think you’ll be surprised how many would download a taxonomy search over category search. Even better if the plug-in could be updated to include both. Would super appreciate it. I really need it and I have no idea how to recode this.
Ok, let me see if I can explain it: it sounds like you need to do two things. First, you need to change all references to the term’s taxonomy from ‘category’ to the taxonomy name(s) you need. Second, you need to change the post type from ‘post’ to the post type(s) you need.
From a cursory search, it looks like the term’s taxonomy is referenced in facetedsearch_add_category (in the POST), facetedsearch_delete_category (in the POST), facetedsearch_activate (in the query), and facetedsearch_category_content (in the query).
To find all references to post type, just do a word search for post_type.
Looking this over again, it seems like it should be pretty easy to implement even for multiple categories if you know your post types and taxonomy names. Making it into a configurable option, however, seems like it might be complex.
If anyone wants to help me support this code, please let me know, as my own time is quite limited right now.
- The topic ‘Faceted Search using custom taxonomies’ is closed to new replies.