Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
Good morning everyone,
I need to be able to insert this piece of code
Code: Select all
<a href="https://www.iubenda.com/privacy-policy/xxxxxxxxx" class="iubenda-white no-brand iubendanoiframe iubenda-embed iub-legal-only iubenda-noiframe iub-body-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>

into an article, so using the text editor (richtext).

I searched the forum and saw some examples of how to implement an "iframe" using shortcodes, but I didn't understand if, in addition to editing the kfunctions.php file, you also need to insert some tags inside the file i need that code.

I also tried directly to implement the iframe function, to see if it worked, but in fact it doesn't work.

Can anyone give me pointers on this?

Thank you
Hi,

This is the ideal use-case for "shortcodes" - you can get full details at https://docs.couchcms.com/miscellaneous/shortcodes.html
Also, since your use-case does not require any manipulation of the data to insert, perhaps you may find the following 'Universal shortcode' a tad easier?
viewtopic.php?f=8&t=13212

Hope this helps.
Hi KK, thanks for the reply.
In fact Universal Code is what I had tried.
I think I followed the guide correctly.
Therefore. I copied the Universal Shortcode script into the kfunctions.php file.

I created the code-snippets.php file in root and pasted the related script.

I put in my page where I want the text to appear
Code: Select all
<cms:editable name='prova' hidden='1'
        label="Try" desc='Insert Try'
        type="richtext" />


And I recall it with the tag
Code: Select all
<cms:show prova/>


But when I insert, the [code test] tag as per example,
I am getting exactly [code test] and not what it should be getting.

I don't understand where I'm wrong
I think that is because you forgot to add the <cms:do_shortcodes> tags - please make your code as follows
Code: Select all
<cms:do_shortcodes><cms:show prova/></cms:do_shortcodes>

Does this help?
:o You are right!!!
I missed it :-(
Sorry for the inconvenience and thank you very much.
You are welcome :)
6 posts Page 1 of 1