Hi,
We have a file download in a accordion tab. We need to place a javascript onclick action to a pdf file download to be able to track it in analytics.
download
I noticed the onclick code is automatically removes when we save the page. How can we resolve this?
Hi rikard,
Can you see the code now?
<a href=""http://www.domainamexx.com/wp-content/uploads/folder.pdf"" onclick=""ga('send', 'event', 'PDF', 'Download', 'PDF Download');"" target=""_blank"">download</a>
Hi,
Sorry but my code section keeps outputting html instead of the code, please try to remove all double quotes in your code. For instance:
""http://www.domainamexx.com/wp-content/uploads/folder.pdf""
Should be:
"http://www.domainamexx.com/wp-content/uploads/folder.pdf"
Best regards,
Rikard
Hi rikard, the double quotes is something that happend here. It is not in the code we use. The problem is thwt the javascript part. The ‘onlick’ is immediately being stripped from the html when the accordion is saved.
Ofcource we input the html in ‘text’ modus.
Seems the javascript is not rendered by the framwork.
How can we input this code in the accordion?
Hey!
Can you maybe try convert the code to shortcode and use it then as that, inside the accordion?
The html output, is not allowed to be something else we are afraid.
Tanks a lot for your understanding
Cheers!
Basilis
Hi Basilis,
A shortcode yes, but that would mean we have to install a plugin for it. That means more code, more weight, slowing down the website. For the use of it, it is overkill.
Too bad the framework (still) does not support this :-(
Hi,
I think Basilis is referring to this here: http://kriesi.at/documentation/enfold/enable-advanced-layout-builder-debug/
Best regards,
Andy