Kelly
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Creating template for displaying relationship hierarchy
Started by: Kelly
in: Toolset Professional Support
Problem: I have 4 post types related in a series of one-to-many (O2M) relationships - child, parent, grandparent, and great-grandparent posts. On the single child post template, I would like to display a breadcrumb trail from all 4 levels of post relationship hierarchy. Solution: From any one level of the hierarchy, you can display information about that level and one level of hierarchy higher. So from the child post context, you can display information about the child and the parent. The idea is that you'll have to create 2 nested Content Templates to switch context up the hierarchy chain one level at a time. Delete the microcycle link and the two grandparent templates from the View for now. Create a mesocycle-breadcrumb template and a microcycle-breadcrumb template. First, the mesocycle-breadcrumb template will include the macrocycle template in the context of macrocycle from mesocycle, and the post link shortcode to display the mesocycle link. The mesocycle link shortcode needs no context because we will set the template context in the microcycle-breadcrumb template where we place the mesocycle template: ( in the mesocycle-breadcrumb template) [wpv-post-link item="@macrocycle-mesocycle.parent"] > [wpv-post-link] Then, the microcycle-breadcrumb template will include the mesocycle template in the context of mesocycle from microcycle, and the post link shortcode - again, it needs no context because we will set the template context in the View where we place the microcycle-breadcrumb template: ( in the microcycle-breadcrumb template) [wpv-post-body view_template="mesocycle-breadcrumb" item="@mesocycle-microcycle.parent"] > [wpv-post-link] Then you'll include the microcycle-breadcrumb template in the View, setting the microcycle context from the session context: (in the Session View) [wpv-post-body view_template="microcycle-breadcrumb" item="@microcycle-session.parent"] > [wpv-post-link] Relevant Documentation: |
2 | 3 | 4 years, 7 months ago | ||
Understanding how layouts work
Started by: Kelly in: Toolset Professional Support |
2 | 5 | 4 years, 7 months ago |