I want to create a list of taxonomies in post content template where selected taxonomies are highlighted.
I'm currently thinking adding a view for that, and shortcode in template might be something like:
[wpv-view name="my-custom-view-for-list" selectedvalues="[wpv-post-taxonomy type="name-of-taxonomy" format="slug"]"]
In the that view I´d like to add condition, which highlights the selected taxonomies.
So... is outputting all the taxonomies and comparing the taxonomy slug with passed value right way?
Is this correct way to do this or is there a better way?
And what kind of condition output should I make in the views loop?
In the Loop Output section of your View where you output the taxonomy terms, you will want to have a container div for those and add a class that you use to highlight those required, wrapping the class declaration in your conditional shortcode that tests whether the current term is in the list of terms passed as a shortcode attribute.
Which is where we run into a problem. The comparisons available in wpv-conditional are =, !=, <, > etc.
We have a feature request to add "CONTAINS" but it is not implemented yet.
If your posts have more than one term assigned then the shortcode attribute will be a comma separated list, so you can't directly compare the current term to this list of terms.
If that is the case (multiple terms assigned) you will need to create a custom shortcode and pass the list of terms to that, perform the comparison in PHP, and return true or false.