Quick 'how to' question for everyone around using Categories across multiple MSM sites.
Here's the situation:
- There is a 'master' (MasterSite) site, and 2 other 'sub-sites' (SiteA + SiteB).
- SiteA and SiteB both have a channel called Events.
- I'm using the standard Channel Entries tag on the MasterSite to show events from both SiteA and SiteB ... and of course using the site="SiteA|SiteB" parameter.
- SiteA and SiteB both have an 'Event Category' group setup.
The issue:
Everything works fine until I have a single list of category names (for filtering). SiteA has the following categories - Wine, Christmas, Mother's Day. SiteB has the following categories - Wine, Christmas, Father's Day.
When I list them out for filtering, I end up with duplicate names: - Wine - Wine - Christmas - Christmas - Mother's day - Father's day
I can see why this is happening, and where the issues are, and get why it has to work like that ... but I want to remove the duplicates! I can handle the filtering part (as I'm using Isotope I actually only need the category name to do the filtering!).
So here are my questions:
- Can I setup and share a single category group across the different sites?
- Is there an add-on that handles this issue?
- Is there a parameter or setting I've missed that 'removes duplicates'?
- Is there simply a better way to do this?
What I've come up with:
- Use javascript to remove duplicates on the fly.
- Use PHP to add in all categories into an array, removing duplicates, then list them out.
I'd rather do these things 'by the book' using built-in functionality if possible ... but am open to other suggestions!
Ready... steady... go!
:)