I am looking to do a faceted search using custom taxonomy terms associated with a custom post type?
Similar to http://www.newegg.com
The FACETED SEARCH plugin does this function but only on categories or tags...
Any help is appreciated.
Is it possible to edit the FACETED SEARCH plugin to reference custom taxonomies instead of categories or tags?
I would be interested in this as well
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.
But posting directly the code instead of explaining 100 times was not better?
Sorry for the late response. Must have missed it. Perhaps I can be a bit more clear. I guess you could say that categories and taxonomies are the same so you could change the name. I organize my site using taxonomies through a free plugin called types (wp-types.com). I also use the Views as well. The issue here is that I can create and organize each category and subcategories of the taxonomy very easily and its VERY SEO friendly AND it's not limited to only posts. Types lets you create as many Custom Post Type categories (CPTs)as you want with linking subcategories. It also lets you do all this inside Pages, Media or whatever you want. It's not limited to Posts. If you want to see what I'm talking about, you can try the types plugin. Should work brilliantly with faceted searching.
I'd love to help you but I'm very much a rookie and have zero coding experience. If there are non coding things I can help you with, let me know. I'll try to help out.
I was able to edit the plugin to work for one custom taxonomy within a custom post type (using version 3.4.4) but I am definitely interested in getting it to work for multiple taxonomies (within the same custom post type). I am able to just hard-code those taxonomies, but I'm not entirely sure how to modify the code to make it work.
Suggestions would be greatly appreciated! :-)
Thanks in advance.
I am also looking to make this same kind of thing work. I need a custom search box that will allow for selecting check-boxes based on custom taxonomies so that users can just select a product type, then price range, color, size, etc and have it display all the 'posts' that match those criteria. I thought I had already seen this before, but maybe nobody has done it yet...?
Well, I will be working on the code if I don't find a solution, but my php skills are quite rusty, so if anyone has found a solution it would be greatly appreciated.
Andrew - I will do my best to help!
I'm working on this right now... http://wordpress.org/extend/plugins/wp-ultimate-search/ . Needed it for a client and there weren't any plugins that did the trick.
Only supports faceting by categories currently, but faceting by tags, users, custom post types, and unlimited post meta (including advanced custom fields) will be available within the next few days.
Would love to get your suggestions if you have a chance to try it out
Hey Sekatsim, this looks good, I like the modern look and functionality.
I'm really busy right now, but if your plugin can allow someone to filter/search from multiple dropdowns, which are dynamically populated from existing custom taxonomies, let me know, I'll be glad to take it for a spin and give you a detailed review!
Just wondering when the faceting by post meta feature of your plug in will be available. I have downloaded and cannot find any feature other than a plain search - pretty sure i'm missing something. help?
It's in the works.. the plugin is almost ready for release, but we're still working out the kinks in the upgrade / authentication process, plus developing our support site, etc.
I'm hoping it'll be out within the next couple of weeks.. maybe sooner. I'll post an update here once it's ready.
This topic has been closed to new replies.