lele_ballack Posted April 10, 2020 Share Posted April 10, 2020 I was given this script to be embedded in the body of a page in order to automatically launch and render the destination link when the page is opened. <a href="https://www.iubenda.com/privacy-policy/*****" class="iubenda-white no-brand iubenda-embed" title="Privacy Policy ">Privacy Policy</a> <script type="text/javascript">(function (w,d) {var loader = function () {var s = d.createElement("script"), tag = d.getElementsByTagName("script")[0]; s.src="https://cdn.iubenda.com/iubenda.js"; tag.parentNode.insertBefore(s,tag);}; if(w.addEventListener) {w.addEventListener("load", loader, false);} else if(w.attachEvent){w.attachEvent("onload", loader);} else{w.onload = loader;}})(window, document); </script> How do I include it in PW? I tried using the CKEditor but it just outputs the script without launching it. If I include it in my template in PHP, it renders as a button that once clicked opens a new tab outside of my website instead of having the script being embedded inside my page. Do you have any suggestion about how to make this work? Link to comment Share on other sites More sharing options...
jacmaes Posted April 10, 2020 Share Posted April 10, 2020 I believe that it's precisely what this script is supposed to do: embedding a button. Quote The standard (and our simplest) integration method consists of including the iubenda button or the link in the pages of your site, typically in the footer. This will open the privacy policy in a modal window (lightbox) when the link is clicked. https://www.iubenda.com/en/help/216-privacy-policy-standard-embedding It seems like overkill to me: it's a just a link after all. I usually just convert it to a plain link, no script required: <a href="https://www.iubenda.com/privacy-policy/xxxxx/legal">Politique de confidentialité</a> Link to comment Share on other sites More sharing options...
jacmaes Posted April 10, 2020 Share Posted April 10, 2020 The script above is supposed to open the privacy in a modal. That's really the only added benefit I see here. Link to comment Share on other sites More sharing options...
lele_ballack Posted April 13, 2020 Author Share Posted April 13, 2020 Thanks for your feedback @jacmaes, I understand your point. Looking at your link though, one of the possibilities to include Iubenda is 'Direct text embedding' which renders the Iubenda page as embedded in your own page layout. Upon further searches, I realised that the only thing that was amiss from the script I was given is the class 'iub-body-embed' which launches the script automatically when opening the page (instead of rendering a button that opens a modal as you correctly pointed out). In order to be able to launch the script through PW, I had to install the module 'Inputfield ACE Extended' which allows to 'write' Javascript directly into the page. It might be a bit of a overkill, yet I think it looks easier to read when it's embedded in a page of its own, inside the website layout. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now