Hello
I'm redoing a site in Elementor which was made some years back in Divi. Divi unfortunately is a pain in the ass when using CPTs so I switched to Elementor last year. This site needs some new functionality so I decided to port it to Elementor. My problem is that there are cases when I use a taxonomy's description field inside html code. For the Region taxonomy I use it's description to store the color codes of the different region. So my code for a title inside a Destination is like this:
<h1 style="color: rgba([wpv-post-taxonomy type='region' format='description'],1.00);">[wpml-string context="content templates" name="Other Destinations"]Other Destinations[/wpml-string]</h1>
This works in Divi but unfortunately is not working in Elementor. If I just add the [wpv-post-taxonomy type='region' format='description'] shotcode that outputs the region's rgb values, but not when inside html code.
Please help me find a solution to this because I use this approach a lot throughout the site, because every Destination gets is colors based on the Region it is part of.
Hello,
It seems to be a Elementor issue, it does not support using shortcode as HTML tag attribute.
As a workaround, you can try these:
1) Create a Toolset content template, for example "my-ct"
Display the HTML codes you mentioned above:
<h1 style="color: rgba([wpv-post-taxonomy type='region' format='description'],1.00);">[wpml-string context="content templates" name="Other Destinations"]Other Destinations[/wpml-string]</h1>
2) In the Elementor text widget you mentioned above, display above content template shortcode, like this:
[wpv-post-body view_template="my-ct"]
More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body
Thank you Luo, this works perfectly!