I have a custom post type for places. I'd like to associate each post by up to 3 geographical regions (country, state, region). I'd like to be able to list them out in a bullet list like:
* Country 1
> State 1
- Place 1
- Place 2
> State 2
- Place 3
etc....
I've looked through the forums with people asking for workarounds. I've tried with hierarchical taxonomy but that doesn't seem to work well with more than 2 levels. I've thought about post relationships but not sure they would work much better. I've thought about custom shortcodes to query by region and hard code the display for Country and State then list out the Places in each Region but I think that may end up being heavy on the DB with a ton of queries.
Rather than asking how to make it work with how I'm trying to do it, I'd like to ask if the Toolset team has a best practice they'd recommend for how I should do it.
Thanks!
Hi Lane,
Thank you for contacting us and I'll be happy to assist.
Your observation is correct and there are more than one ways to connect multi-level objects (eg. Countries > States > Places ).
But in my experience, using post-relationships has its advantages, over other approaches.
Which means that Countries, States, and Places can all be added as custom post types and then linked to each other through one-to-many relationships.
1. Countries will have a one-to-many relationship with the States
2. States will have a one-to-many relationship with the Places
This approach will allow you to use search filters in Toolset Views and fields in Toolset Forms, in a natural hierarchal way, without any additional customization or workaround.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Thank you for the advice! I'll work with that. Much appreciated!