I am trying to: get markers based on a taxonomy
Link to a page where the issue can be seen:
This is a page where the view has a conditional included based on a custom taxonomy: hidden link
This is a page with the view without custom taxonomy: hidden link
I expected to see:
Functionality similar to: hidden link
Instead, I got:
hidden link
I have made this functionality on Norface.net before with the help of Shane. However when i try to transfer the functionality to Schuldenlab i get an error. It seems i have set it up exactly the same, however the map/markers won't load because of the conditional statement.
Hi can you share all the code used to display this map and markers, including the conditional?
Please turn on debugging by adding debug="true" to the conditional so we can see what is happening.
[wpv-conditional if="( ...your conditions here ... )" debug="true"]
...
This will output some information to the front-end. Please share that information with me here.
Hi,
thank you for your reply. I added the debug to the conditionals. You can see it here: hidden link
The map code is: [wpv-map-render map_id="map-1" scrollwheel="off"]
The list code in the main content is:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-conditional if="( has_term('evenement','mapcategorie',null) eq '1' )" debug="true"]
[wpv-map-marker map_id="map-1" marker_id="marker-[wpv-post-id]" marker_field="wpcf-locatie" marker_icon="hidden link"][/wpv-map-marker]
<div class="partner-row [wpv-post-taxonomy type="mapcategorie" format="slug" separator=" "]">
[wpv-post-title]
</div>
[/wpv-conditional]
[wpv-conditional if="( has_term('partner','mapcategorie',null) eq '1' )" debug="true"]
[wpv-map-marker map_id="map-1" marker_id="marker-[wpv-post-id]" marker_icon="hidden link" marker_field="wpcf-locatie"][/wpv-map-marker]
<div class="partner-row [wpv-post-taxonomy type="mapcategorie" format="slug" separator=" "]">
[wpv-post-title]
</div>
[/wpv-conditional]
[wpv-conditional if="( has_term('project','mapcategorie',null) eq '1' )" debug="true"]
[wpv-map-marker map_id="map-1" marker_id="marker-[wpv-post-id]" marker_icon="hidden link" marker_field="wpcf-locatie"][/wpv-map-marker]
<div class="partner-row [wpv-post-taxonomy type="mapcategorie" format="slug" separator=" "]">
[wpv-post-title]
</div>
[/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]
Okay, I don't see any debugging information written out to the page here:
hidden link
So there must be something else going on. Can you try the following troubleshooting steps?
- Go to Toolset > Settings > Frontend Content and find the section "Functions inside conditional evaluations". Check to be sure "has_term" is listed here. If not, enter "has_term" and try again.
- Copy the conditionals and paste them again at the top of the loop, but replace the contents with basic text:
[wpv-conditional if="( has_term('evenement','mapcategorie',null) eq '1' )" debug="true"]
evenement
[/wpv-conditional]
[wpv-conditional if="( has_term('partner','mapcategorie',null) eq '1' )" debug="true"]
partner
[/wpv-conditional]
[wpv-conditional if="( has_term('project','mapcategorie',null) eq '1' )" debug="true"]
project
[/wpv-conditional]
What do you see when you test this basic implementation?
Hi Christian,
once again you have pointed me in the right direction. I spend the better part of a day pulling out my hair on why it was not working. It was indeed the issue that i did not register the script.
Thank you again and have a nice day.
Kind regards,
Glenn