Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2021-06-17 13:36:50

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Shortcode for youtube embed and schema

Bloke wrote #330542:

It’s fine as-is. We don’t enforce it in core, besides new installs shipping with it set to utf8-mb4 by default.

Phew, thanks Stef, and that explains the emoji issue too!!


…………………
I <3 txp
…………………

Offline

#17 2021-06-24 19:28:08

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Shortcode for youtube embed and schema

Hi folks, I have a shortcode query to tack on.. so I have a shortcode calling an img with text from a form so that I can do a two col img/text within an article. For the text, it would be very handy to be able to skip lines within the tag and have those automatically turn into p tags but I’m not sure if it’s possible, when I skip a line at the min in the text variable it does break the tag so it can’t seem to cope with that. If anyone can help thanks so much!

Shortcode:

<txp::img_left mythumb="288" text="These measures make your website more resistant to hacking and/or data sniffing. In this era of GDPR protection these measures help keep your data, and your visitors data safe and secure." />

Form:

<div class="flex-container">
<figure class="flex-item">
<txp:images id="<txp:yield name="mythumb" />">
<img src="<txp:image_url id="<txp:yield name="mythumb" />" thumbnail='1' />" width="<txp:image_info id="<txp:yield name="mythumb" />" type='thumb_w' />" height="<txp:image_info id="<txp:yield name="mythumb" />" type='thumb_h' />" loading="lazy" alt="<txp:image_info id="<txp:yield name="mythumb" />" type='alt' />" title="<txp:image_info id="<txp:yield name="mythumb" />" type='caption' wraptag='' class='' escape='unset' />" class="fade image" /></txp:images>
</figure>
<div class="flex-item"><p><txp:yield name="text" /></p></div>
</div>

…………………
I <3 txp
…………………

Offline

#18 2021-06-24 20:27:08

etc
Developer
Registered: 2010-11-11
Posts: 5,677
Website GitHub

Re: Shortcode for youtube embed and schema

Hi Hilary, not sure to fully understand your question, but you can try to replace

<div class="flex-item"><p><txp:yield name="text" /></p></div>

with

<div class="flex-item"><txp:yield name="text" escape="textile" /></div>

Offline

#19 2021-06-25 11:30:40

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Shortcode for youtube embed and schema

etc wrote #330661:

Hi Hilary, not sure to fully understand your question, but you can try to replace

<div class="flex-item"><p><txp:yield name="text" /></p></div>...

with

<div class="flex-item"><txp:yield name="text" escape="textile" /></div>...

Hi Etc, I did try that but I just skipped lines within the text content in the hope the skipped lines would then translate into p tags by using the escape textile tag, but it just put the code on the page overall without now showing the actual img or text..


…………………
I <3 txp
…………………

Offline

#20 2021-06-25 11:38:25

etc
Developer
Registered: 2010-11-11
Posts: 5,677
Website GitHub

Re: Shortcode for youtube embed and schema

Could it be quotes? This pattern

<txp:image_url id="<txp:yield name="mythumb" />" ...

will not work as you expect, it should be

<txp:image_url id='<txp:yield name="mythumb" />' ...

Offline

#21 2021-06-25 12:11:03

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Shortcode for youtube embed and schema

etc wrote #330684:

Could it be quotes? This pattern

<txp:image_url id="<txp:yield name="mythumb" />" ......

will not work as you expect, it should be

<txp:image_url id='<txp:yield name="mythumb" />' ......

Will test that later thanks so much for all your help with everything!


…………………
I <3 txp
…………………

Offline

Board footer

Powered by FluxBB