Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I am using the excellent tim's All-purpose embed shortcode
to embed AMP images in my rich text editor.

And it works like a charm.

But, when I try to use it on global, to get custom fields to my pages, it does not work.

For example:

Code: Select all
[embed code='<amp-img src="https://www.mywebsite/couch/uploads/image/blog/image.jpg" width="768" height="578" alt="" layout="responsive" ></amp-img>']

does not work in

Code: Select all
<cms:do_shortcodes><cms:get_custom_field 'maintext' masterpage='globals.php' page=k_folder_name /></cms:do_shortcodes>

Any idea why?
Hi Paolo. I tested the issue, and got a strange result.

I copied and pasted your exact embed code into a text field on a template. When I saved it, the code was mangled. It appears that the amp-img tag is triggering some sort of xss defense.

When I used a textarea field with no_xss_check='1', the code passed through unmolested. Same with richtext.

Is that any help?

In fact it was simpler than that. The text module and/or the shortcode doesn't acccept the sintax:
<amp-img src="https://mywebsite/images/image.jpg" width="768" height="578" alt="" layout="responsive"></amp-img>
but need a self closing tag like:
<amp-img src="https://mywebsite/images/image.jpg" width="768" height="578" alt="" layout="responsive"/>

Thanks for lookiing into it, anyway.

3 posts Page 1 of 1

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 3 guests