I have created this view 2 months ago.
It used to work but suddenly stopped displaying the orange markers.
Instead of displaying different markers for each "status" (orange for Wonend, blue for the rest) all markers are blue.
Did I make a mistake in the view code?
[wpv-layout-start]
[wpv-items-found]
[wpv-map-render map_id="map-1" map_height="500px"][/wpv-map-render]<!-- wpv-loop-start -->
<wpv-loop>
[wpv-conditional if="( $(lvgo_status_woongroep) eq 'Wonend' )"]
[wpv-map-marker map_id="map-1" marker_id="marker-[wpv-post-id]" marker_title="[wpv-post-title]" marker_field="wpcf-adres-woongroep" marker_icon="hidden link" ]
<h3>[wpv-post-link]</h3>
[wpv-conditional if="( $(lvgo_adres_woongroep) ne '' )"][types field='lvgo_adres_woongroep'][/types]<br>[/wpv-conditional]
[wpv-conditional if="( $(lvgo_postcode_woongroep) ne '' )"][types field='lvgo_postcode_woongroep'][/types][/wpv-conditional]
[wpv-conditional if="( $(lvgo_plaatsnaam_woongroep) ne '' )"][types field='lvgo_plaatsnaam_woongroep'][/types]<br>[/wpv-conditional]
info:
[wpv-conditional if="( $(lvgo_naam_contactpersoon) ne '' )"][types field='lvgo_naam_contactpersoon'][/types]<br>[/wpv-conditional]
[wpv-conditional if="( $(lvgo_btelefoon) ne '' )"][types field='lvgo_btelefoon'][/types]<br>[/wpv-conditional]
[wpv-conditional if="( $(lvgo_bemail) ne '' )"][types field='lvgo_bemail'][/types][/wpv-conditional]
[/wpv-map-marker]
[/wpv-conditional]
[wpv-conditional if="( $(lvgo_status_woongroep) eq 'Initiatief' )"]
[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-id]' marker_field='wpcf-adres-woongroep' marker_icon="hidden link"] <h3>[wpv-post-link]</h3>
[wpv-conditional if="( $(lvgo_adres_woongroep) ne '' )"][types field='lvgo_adres_woongroep'][/types]<br>[/wpv-conditional]
[wpv-conditional if="( $(lvgo_postcode_woongroep) ne '' )"][types field='lvgo_postcode_woongroep'][/types][/wpv-conditional]
[wpv-conditional if="( $(lvgo_plaatsnaam_woongroep) ne '' )"][types field='lvgo_plaatsnaam_woongroep'][/types]<br>[/wpv-conditional]
info:
[wpv-conditional if="( $(lvgo_naam_contactpersoon) ne '' )"][types field='lvgo_naam_contactpersoon'][/types]<br>[/wpv-conditional]
[wpv-conditional if="( $(lvgo_btelefoon) ne '' )"][types field='lvgo_btelefoon'][/types]<br>[/wpv-conditional]
[wpv-conditional if="( $(lvgo_bemail) ne '' )"][types field='lvgo_bemail'][/types][/wpv-conditional]
[/wpv-map-marker]
[wpv-conditional if="( $(lvgo_status_woongroep) eq 'Bouwend' )"]
[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-id]' marker_field='wpcf-adres-woongroep' marker_icon="hidden link"] In oprichting: [wpv-post-link][/wpv-map-marker]
[/wpv-conditional]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]
Hi,
It seems to be a problem of nested shortcode, you are using such kind of nested shortocde:
[wpv-conditional ...]
[wpv-map-marker ... ]
[wpv-conditional ...]...[/wpv-conditional]
[/wpv-map-marker]
[/wpv-conditional]
It might conduct unexpected result,
I suggest you create two content templates, for example:
- wonend-ct
- Initiatief-ct
put the the [wpv-map-marker] shortcode content into those content template, and display the content template inside the top level [wpv-conditional] ... [/wpv-conditional], like this:
[wpv-conditional if="( $(lvgo_status_woongroep) eq 'Wonend' )"]
[wpv-post-body view_template="wonend-ct"]
[/wpv-conditional]
[wpv-conditional if="( $(lvgo_status_woongroep) eq 'Initiatief' )"]
[wpv-post-body view_template="Initiatief-ct"]
[/wpv-conditional]
More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body
Hi Luo,
I dit as you suggested. However, the problem persisted.
Then I inspected my code again and I noticed that there was one closing shortcode missing: [/wpv-conditional].
That resolved the problem, both in my original view (with nested shortcodes) and in the new view (with 2 content templates).
Thank you anyway, my problem is solved.
My issue is resolved now. Thank you!
Thanks for sharing the solution.