Hi support! I have a page with news articles where I want to display all related newsarticles. I've made a custom post type so I didn't use the default post type.
In the parent content template (template-parent.png), I've set a shortcode attribute that gets the current category. In the child view (view-child.png), I filter the results on that shortcode attribute.
3 on 4 shortcodes do work (see hidden link).
But the 4th isn't working at all: no related newsitems are queried (see hidden link).
I guess it's because it contains one ampersand and/or multiple (space).
Could that be a correct guess? How can I solve this?
In the parent content template (template-parent.png), I've set a shortcode attribute that gets the current category.
Where? I don't see anything related to categories in this screenshot. I see a Types field shortcode related to the inspiration field, but nothing related to categories, taxonomies or terms.
I guess it's because it contains one ampersand and/or multiple (space).
Could that be a correct guess?
I don't think it has anything to do with ampersand or spaces. You should definitely use output='raw' in the Types field shortcode you have nested in the inspiration attribute, like this:
[wpv-view name="nieuwsartikels-gerelateerd" inspiration="[types field='inspiration' output='raw'][/types]"]
If that doesn't solve the problem, please add some extra debugging information in the Content Template so I can see the value of the inspiration field:
Inspiration: [types field='inspiration' output='raw'][/types]<br />
[wpv-view name="nieuwsartikels-gerelateerd" inspiration="[types field='inspiration' output='raw'][/types]"]
Then show me a screenshot of a niewsartikel post in wp-admin that has a matching inspiration field.
Great! Adding output='raw' did the trick, very happy with that simple solution. Thanks a lot Christian!