I have a conceptual question and I'm not sure how I should tackle this. I have a page wich I have build completely customized by adding all the content and links by hand: hidden link
I would like to rebuild the page using Toolset. For now this is what I already have in mind:
-A post type "Countries" (in the case of my site that would be Thailand, Vietnam, Laos)
-A post type "Activities" (in the case of my site that would be Inseln im Golf von Thailand or Inseln Adamanensee inside the Strand & Inseln box)
-A taxonomy "Travelstyle" (in the case of my site that would be Strand & Inseln, Nature, Adventure, etc) which is available on Countries and Activities
-A post relation between Countries and Activities
On a Country post, I would now like to re-create the boxes you see on my sites using Toolset and dynamically fill them. I thought this must be somehow possible using a post relation combined with the taxonomy. I'm unsure how to do it though.
I guess I would need to create a view which shows the Travelstyle taxonomy but it must only show those travelstyles which are associated with the currently viewed country.
Then I probably need another view which I put inside the first view which shows the titles of the activities associated with the travelstyle its displayed in, right? But it must only be those which are also related to the current country.
How do I do this? How can I limit shown taxonomies to the Country they are shown on and how can I limit the Activities to the encapsulating taxonomy AND the current Country post?
I hope you understand what I mean and can help me somehow. I'm a programmer so as long as you give me the general concept I should be fine. Thank you for your time.
Hello,
I assume we are talking about this case:
In a single "Countries" post, you are going to display the related "Activities" posts who are using the same "Travelstyle" terms.
If it is, it is possible within a nested view, for example:
1) Parent taxonomy view, list terms of taxonomy "Travelstyle", filter by:
Taxonomy is set by the page where this View is inserted
See screenshot taxonomy-filter.JPG
And display below child view
2) Child post view, list posts of post type "Activities", filter by:
Select posts with taxonomy:
Travelstyle set by the parent Taxonomy View
And display the "Activities" post information
More help:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/
Views Inside Views – Display Nested Multidimensional Lists
Hmm I guess I used the wrong View type. I didn't see that query filter on the parent.
In the child view, it absolutely makes sense to only display those Activities which match the term of the taxonomy set by the parent but how do I also limit it to the enclosing Country post?
Example:
-Country Thailand
--Travelstyle: Islands
---Activity: Koh Chang
---Activity: Koh Tao
-Country Laos
--Travelstyle: Islands
---Activity: Don Det
Is there a query filter on the View for the parent post via post relation or do I need to somehow code this myself? If so, can you give me a hint where to hook myself into? 🙂
I figured it out. I didn't know I could add a term filter for the parent views term as well as the post relation filter at the same time. This totally works. Thanks a lot for your help. Now I have one final question:
Now that I can display the activities of the travel styles nested inside the travel style on the country, I would now have a country dependent image for each travel style.
Lets take the example form my last post. Thailand as well as Lao both have the travel style "Islands". Islands is a term of the taxonomy. I know I can add image fields to the taxonomy but then I could only set the image once and show the same island image on both countries. I'd like to show a different image for islands when displayed on each country though.
Is there some easy way of doing this or would I need to create yet another post type, create another relationship between country and that new post type, add the travel style taxonomy to the new post type as well and then create a post for each of the travel styles and each country? I guess that will work but it seems very complex and a bit error prone. Maybe you have a better idea?
I assume the original question of thread has been resolved, for the new question, please check the new thread:
https://toolset.com/forums/topic/split-displaying-posts-via-post-relation-taxonomy/