Another one I don't get. I'm trying to display brother posts in a template but I came across this quirk. When adding a query filter I get the message that nothing is selected in the Content Selection section but clearly there is. Because of this I'm getting the wrong output in the backend and 'No items found' in the front end... In the second screencap you can see the way I set up the query filter.
Rens
Okay thanks for the report. I'm not able to replicate this in a quick test on my local environment, so I checked in wp-admin on your site to see if I can figure out what is happening. I assume you are editing this Content Template: hidden link
Is this correct? If so, I do not see the problem here. I am attaching a screenshot showing what I see. The Vacatures post type is selected, and I do not see the warning message "There is no post type selected in the Content Selection section". Are there some other steps I need to take to see the problem? Please provide more details here.
Hi Christian,
Yep that's the content template I am editing. I want to show brother posts in the bottom view in the right side bar on this page.
I just checked and the issue only occurs when selecting query filter 'bovenliggend element' which I believe is the Dutch naming for 'parent post'. In the attached screenshot you can see the selected option. Selecting other filter options in this list does not result in the error prompt.
Thanks,
Rens
Okay thank you I see the problem. It is important to understand the difference between Toolset's Post Relationships and WordPress hierarchical post types. The Query Filter Berichtrelatie of eigenaar herhaalbare veldgroepen should be selected to filter using Toolset's Post Relationships feature. The Bericht bovenliggend element filter does not work with Toolset's Post Relationships. The bovenliggend (post parent) Query Filter is only useful with hierarchical post types, like WordPress Pages. In a WordPress hierarchical post type like Pages, one Page can be the parent of another Page. The "bovenliggend element" filter can be used to filter by these hierarhical post parents, but it cannot be used to filter by Toolset's post relationship post parents. If you want to filter by Toolset's Post Relationship parents, use the Berichtrelatie of eigenaar harhaalbare veldgroepen filter. I hope this helps clarify.
Okay, I've selected the Berichtrelatie query filter now. How do I set it up correctly to display brother posts? I have tried using this shortcode in the 'set with shortcode' option:
[wpv-post-url id="$parent"]
The attribute only allows for lowercase letters and number though.
Thanks again,
Rens
Hi, there's not currently a way to pass a shortcode attribute into a View constructed in the Block Editor. Normally, you would use a shortcode attribute like "wpvrelatedto", then pass the parent post's ID into a shortcode attribute like this:
[wpv-view name="Your View Name" wpvrelatedto="[wpv-post-id item='@relationship-slug.parent']"]
However, since the View is constructed in the Block Editor there isn't a way to achieve what you want. I recommend building the View separately, then including it in the Block Editor in a text block instead of a View block. You will be able to add the shortcode attribute here.
Okay, will try it tonight. Should be fine from here. 🙂
Rens