Home › Topic Tag: Displaying post relationships
Views is a WordPress plugin that lets you display post relationships. In our user guides, you can find more information on how to display child posts, related posts, brother pages, fields of parents and fields of grandparents. When you ask for help or report issues, make sure to tell us the type of the relationship you are trying to build and the structure of your data.
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
I have one things left to do: combine my forms
Started by: larryL in: Toolset Professional Support |
|
2 | 5 | 4 years, 11 months ago | |
Followup from the previous post
Started by: yosukeS
in: Toolset Professional Support
Problem: In child post form, display grand parent post information. Solution: You can try with a content template, for example: https://toolset.com/forums/topic/followup-from-the-previous-post/#post-1708411 Relevant Documentation: https://wp-types.com/documentation/user-guides/views-shortcodes/#wpv-search-term |
|
2 | 13 | 4 years, 11 months ago | |
“Not found” message in nested View
Started by: nicolaS-3
in: Toolset Professional Support
Problem: I have two nested Views set up to display a list of child posts. If no child posts are found, I would like to display "No items found" once. However, if I add the "No items found" message in the child View, it is repeated for each parent post. If I add it in the parent View, it is never shown because there are always parent posts. Solution: There is not a simple way to set this up because each child View is rendered independently of the other child Views. There is no built-in way to keep a running total of all child posts across the nested Views, so a custom code solution in the classic Views editor is required. You must use a custom shortcode to add the number 1 each time a child post is displayed. Then use a conditional to test the total amount after all the child post loops have run. First, add these two custom shortcodes in your child theme's functions.php file, or in a new custom code snippet in Toolset > Settings > Custom Code: // https://toolset.com/forums/topic/not-found-message/ global $total; function add_total_shortcode($atts, $content = '') { global $total; $total += wpv_do_shortcode($content); } add_shortcode('add-to-total', 'add_total_shortcode'); function show_total_shortcode( $atts, $content ) { global $total; $atts = shortcode_atts( array( 'decimals' => 0 ), $atts ); $totalNew = $total; $total = 0; return number_format($totalNew, (int) $atts['decimals'] ); } add_shortcode('show-total', 'show_total_shortcode'); Go to Toolset > Settings > Front-end Content and register show-total in Third-party shortcode arguments. In your child View, insert the following code somewhere inside the wpv-loop tags: [add-to-total]1[/add-to-total] Then in the parent View, insert the following conditional shortcode somewhere outside the wpv-loop tags but inside the wpv-items-found shortcode: [wpv-conditional if="( '[show-total][/show-total]' gte '1' )" evaluate="false"] There are NO child posts [/wpv-conditional] You may replace the text with your own custom message as needed. |
|
2 | 7 | 4 years, 11 months ago | |
Open link to related post in new window using wpv-post-link
Started by: leilaG
in: Toolset Professional Support
Problem: I have a View that shows posts from post type A. I would like to include a link to related post type B, and I would like for the link to open in a new window/tab. Solution: Build a link manually in HTML using the target attribute to open in a new window. Use the item attribute in wpv-post-url and wpv-post-title shortcodes to insert information about a related post. <a href="[wpv-post-url item='@occupier.parent']" target="_blank">[wpv-post-title item="@occupier.parent"]</a> Relevant Documentation: https://toolset.com/documentation/user-guides/views/views-shortcodes/ |
|
2 | 5 | 4 years, 11 months ago | |
A view displaying fields from one CPT, in a content template for another CPT.
Started by: andrewS-10
in: Toolset Professional Support
Problem: I would like to display fields from one custom post type in another custom post type by relating posts to one another. Solution: You can use a post reference field to establish a link between two posts in different post types. Then you can use a Fields and Text block to insert fields from a related post in the Content Template. Relevant Documentation: https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/using-post-reference-fields-to-display-information-from-a-related-post/ |
|
2 | 5 | 4 years, 11 months ago | |
Get terms from children posts
1
2
Started by: romanB-3
in: Toolset Professional Support
Problem: I would need to display most popular terms for all children posts of a parent post type. Solution: It needs custom codes, for example: https://toolset.com/forums/topic/get-terms-from-children-posts/#post-1690215 Relevant Documentation: |
|
3 | 30 | 4 years, 11 months ago | |
Create a grid of parent posts, with lists child posts for each parent
Started by: stewartE
in: Toolset Professional Support
Problem: I have two post types in a one-to-many post relationship, where Department is the parent post type and Service is the child post type. I would like to create a grid showing one parent Department post in each grid cell. Inside each grid cell I would also like to display a list of all the child Services for that parent Department. Solution: Use nested Views to accomplish this in the legacy Views editor. The general process: Relevant Documentation: |
|
2 | 3 | 4 years, 11 months ago | |
Relationship Breadcrumbs
Started by: clayH-2 in: Toolset Professional Support |
|
2 | 3 | 4 years, 11 months ago | |
relarionship does not work when deleting custom post entry
Started by: kostasO in: Toolset Professional Support |
|
2 | 3 | 4 years, 11 months ago | |
Display Repeatable Group Buttons Inline
Started by: theC in: Toolset Professional Support |
|
2 | 11 | 4 years, 11 months ago | |
How do I get the child to automatically update the parent's related information section
Started by: larryL in: Toolset Professional Support |
|
2 | 4 | 4 years, 11 months ago | |
Filter Posts by their Repeatable field group data
Started by: BrandenT2154 in: Toolset Professional Support |
|
2 | 2 | 4 years, 11 months ago | |
Recursive view
Started by: henriqueD in: Toolset Professional Support |
|
2 | 6 | 4 years, 11 months ago | |
Query custom view, show only parents that have published child
Started by: ricardoL-4 in: Toolset Professional Support |
|
2 | 15 | 4 years, 11 months ago | |
I want to add parent texonomy and child texonomy search filter dropdown in view
Started by: vimalS in: Toolset Professional Support |
|
2 | 3 | 4 years, 11 months ago |