What is being down here is that you will need to have a different conditional for each taxonomy term and then switching the markers in each conditional.
Since has_term is a custom function you will need to add it to the views custom functions in Toolset->Settings->Frontend
This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Notice i've added the marker_icon attribute, so I use the conditional to check and then display the item with a custom marker.
Please let me know if this helps.
I see why this isn't working and it's because the taxonomy term you are checking is not attached to the Hylek CPT. Its actually attached to the Parent CPT.
In order to check for the taxonomy it must be attached to the current post tht the view is displaying.
Please tell me how to do this? Because I create the markers in the helyek child view, which means places in Hungarian.
After I can show the markers differently based on event type I'll also have to create a filter for those event types and have checkboxes to show only the selected event types.
You added Event Type to a PLACE (Helyek = places). A pub for example cannot have an Event Type, that belongs to Events. That's why I set up two CPT's because there are separate things. An event can take place in multiple Places and a Place can host infinite number of events in many categories. That's why I have a many to many relationship. I cannot give an Event Type taxonomy to a Place, that's totally incorrect.
I'll have to present Events and Places too, every Event will have a post where the Place is listed, and every Place will have it's own post where you can view it's upcoming events and it's past events as image galleries. Do you understand the logic of this site?
I understand what you're saying about this, however in your case you want to change the map markers based on the Event Type.
We are using the conditional statement to check the event type, however the has_term function will check the current post. This would mean its checking the Helyek CPT and not the event CPT.
From what we have we know that the Helyek CPT doesn't have the Event Type Taxonomy attached to it, so all the conditionals will return false.
The logic of the site is clear but in achieving the specific detail of the different marker would require some breaking of the logic.
What you can do tho if you don't want to use the taxonomy you will need some way of marking the Helyek with some event type so that the markers can be changed.
But it is not possible to break this logic... Because you cannot set only one event type to a place. Because it would show for example a concert marker for a sports event...
Is it possible another approach maybe?
I understand that the conditionals are in the child view for another CPT but in the same child view I have marker informations from the Parent view, like event date... You helped me with that if I'm not mistaken.
After this is solved I'll also have to create a custom filter for those event types and have checkboxes to show only the selected event types. This won't be possible either?
For the custom filters this can be added to the parent view so that you can filter it from there. This wouldn't be an issue since if the parent view filters then the child view is filtered as well because its dependent on what the parent is displaying.