Greetings,
I need to display two different icons (markers) on a map according to the category to which a custom post belongs.
How can i do this with toolset maps?
So I've setup the template here below where you can see that i've added the conditional to check if the post has a specific taxonomy assigned. hidden link
Secondly this happens only after the search is done because on the initial map page you aren't displaying the results. The problem is that we have to use the marker shortcodes to conditionally display the markers.
If you display the results on the first page then the markers will also get switched to the conditional ones.
ok,
i've seen that marker is now different by category (i change it in future with correct marker icon) if you can explain me where i must do it.
But there is 2 problem:
1) all icon now redirect to same post (hidden link)
2) i want if is possible to have also in first page all icon different by category, i use two maps only to exclude search results in llist in front page, then if there is any other method is good.
i've seen that marker is now different by category (i change it in future with correct marker icon) if you can explain me where i must do it.
The marker information is now constructed as a shortcode. Now if you look at the shortcode below you will see the marker_icon parameter. This is where you will pass the URL of the marker that you want to use.
Now you can just change the hospital-1.png to the filename of the other marker icons that are available. Here is a screenshot of the names of the other Icons.
1) all icon now redirect to same post (hidden link)
I've resolved this by change the code to use the post url so it should now be directed to the respective post.
2) i want if is possible to have also in first page all icon different by category, i use two maps only to exclude search results in llist in front page, then if there is any other method is good.
The markers would change if the view was listing out the items, however unless the view is listing out the posts then the markers will remain the default given that the results aren't there to manually pass the conditional markers to the map.
The only way to resolve this is to allow the results to be displayed without the view filter being triggered as yet.
ok, i have fixed title and name on maps, but last question, i have ssen that i must edit code in editor mode, is right?
Tahn if i want to use 2 conditions, like a category and a "Stato Attività" to differ with more of 2 icon, how can i do it? i ned to nest conditional or can i use AND operator?
i have ssen that i must edit code in editor mode, is right?
That is correct. The code that you should edit is located at the link below. hidden link
how can i do it? i ned to nest conditional or can i use AND operator?
For this if its to do a combination lets say if Post A meets X and Y condition then you can edit the conditional block and use the AND operator to add your other criterias.
You should see a plus icon, click the plus icon and you should be able add a new conditional. From there you should be able to setup your new conditional and see the option to set the conditional relationship to an AND or OR.
Please let me know if any further clarity is needed.