Hi,
is it possible to place an wpv-conditional argument within another wpv-conditional?
This is my present code:
[wpv-conditional if="(has_term('existing-team', 'neighbourhood-typ', null) eq '1')"]
[wpv-map-marker map_id="map-5" marker_icon="hidden link" marker_id='marker-[wpv-post-id]' marker_field="wpcf-anschrift" marker_title="[wpv-post-title output='sanitize']"]
<img src="[types field='header-image' width='600' url='true'][/types]" width='600' align='middle'/>
<h2>[wpv-post-title output="sanitize"]</h2>
<div style="font-size:16px;">
Neighbours: [types field='neighbours' output='raw'][/types]
Neighbourhood Type: [wpv-post-taxonomy type="neighbourhood-typ" format="name"]
City: [wpv-post-taxonomy type="city" format="name"]
Province: [wpv-post-taxonomy type="country" format="name"]
</div>
[/wpv-map-marker]
[/wpv-conditional]
I want to insert a condition that "Neighbours" are only shown if they have data:
[wpv–conditional if="('1' eq '1')"]Neighbours: [types field='neighbours' output='raw'][/types][/wpv–conditional]
I know I have to change the condition, but is it possible to insert an wpv-conditional argument within another wpv-conditional at all?
When I tried it showed the inserted argument as plain text.
Thank you for your help!
André
Hello,
It is possible to use wpv-conditional within another wpv-conditional shortcode(nested wpv-conditional shortcodes).
But according to our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional
When using very long content with the conditional shortcode you might encounter an error. Since Views uses native WordPress parsing for all shortcodes, this limitation does not come from the Views itself. In such cases, there is no alternative but to break up the content into smaller sections, which may mean having to repeat the conditional statements.
In order to avoid above issue, you can put the inner wpv-conditional shortcode into a content template, and display this content template with [wpv-post-body] shortcode.
More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body