I'm wanting to filter a list of product entries with Ajax and I am wanting to create a dropdown list of all categories associated with the current list of entries.

eg. I have 100 products that have a main category and have all been assigned a category or two for filtering. In the dropdown list, I want to show ONLY the filtering categories that have been assigned to the current list of products.

So far, I've got a list of ALL categories from a group and not the limited list based on the products in the main category.

I'm currently playing with the query module to see if I can filter the category list down to the correct list of filtering categories.

Its a tough one to explain, but I hope I have done a good job.

Does anyone know the best approach?

I've test GWcodes categories and provided a list of entry_ids, however this shows up a list duplicated categories. Basically the right result, but I get duplicates.

Any help and guidance would be gratefully received.


  • U looking to replicate something like isotope js functionality ? Commented May 14, 2014 at 13:06
  • Hi Stuartmcd69 - Kind of, but not really. I'm using JPList. Similar functionality, but slightly different. Cheers.
    – T2theC
    Commented May 14, 2014 at 13:10

2 Answers 2


If you have easy access to the entry_ids of the visible entries as a comma-separated list, this query should work:

SELECT DISTINCT cat_id FROM exp_category_posts WHERE entry_id IN(1,2,3,4,5)

Maybe you could benefit from a module like this: http://devot-ee.com/add-ons/reefine

Might save re-inventing wheel, maybe.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.