Hi,
I have a site with a standard template for pages built as a Toolset Content Template, it's called "Template for Pages new". (I'm using Beaver builder for the design.) I'm picking custom fields and relationships fields from the page, including a couple of listings/views, and have managed to display them correctly on the frontend. I put them in a column on the right with the intention to make it look like a information sidebar.
Example: hidden link
Now, my client, wants me to add sub/child pages to some of the pages. So now the same information has to be moved to the subpages. The parent page will not have the info anymore on the frontend, but it still has to be entered on the same (parent) page and be displayed equally on the sub/child pages.
Example parent page: hidden link
Example sub/child page: hidden link
I have created a new Content Template called "Template for Pages Parent" and tried to modify the shortcodes, but as I understand it you need som kind of grandparent connection to make it work. I checked out this link, https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-fields-of-grandparents/, but I didn't really get it. I tried that small content template for the extra parent level, but never succeeded.
There are three different shortcodes I'd like help with:
1. A field in a reference field in the CPT Platserinfo/Platsinfo.
[types field='postadress' item='@platsinfo.parent'][/types]
2. A view called "Events platser" showing Events filtered by Platserinfo/Platsinfo reference field.
[wpv-view name="events-platser" wpvrelatedto="[wpv-post-id item="@platsinfo.parent"]"]
3. A view called Kontaktpersoner filtered by post relationship Kontaktpersoner (Pages<->Personer)
[wpv-view name="kontaktpersoner"]
Containing the content template fields:
[types field='ansvarsomrade' item='@kontaktperson.intermediary'][/types]
[wpv-post-title], [types field='befattning' output='raw' ][/types]
[types field='telefonnr' output='raw' ][/types]
[types field='epost'][/types]
I started to target my shortcodes with the corresponding parent page id as a solution, but didn't make it on shortcode #3. But with that approach I have to make a new template for each group of child pages. Better to do it properly.
Hope you can help me out!
Regards Mats