Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 Yesterday 22:20:23

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,127
Website GitHub

Re: Feedback: Textpattern CMS 4.9.0 released

Vienuolis wrote #341988:

Unfortunately, all images displayed via yield="id" have disappeared. I am not a programmer, just blindly copied the following code from this forum :)

<figure<if::yield name="class"> class="<txp:yield name='class' />"</if::yield>>...

(I would usually do id='<txp:yield name="id" />' where you currently have yield="id", but maybe the notation you have is also possible?)

It looks like the code you copied is for a shortcode form where you specify the image id number. So you would save that in a form – let’s call it figure – and then call it in your template, or in your article body like this:

<txp::figure id="123" class="img-embed" />

where 123 is the image id number. You can also specify multiple image id numbers, e.g. 12, 23, 34, and optionally omit the class if you don’t need it. Used as a self-contained tag, it automatically pulls in the image caption saved with the respective image, but you can override that by using it as a container tag, e.g.:

<txp::figure id="123" class="img-embed">My  custom caption _with textiled text_.</txp::figure>

If you save your form as another name, your tag will be <txp:formname ….


TXP Builders – finely-crafted code, design and txp

Offline

#50 Today 07:31:33

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 321
Website GitHub GitLab Mastodon Twitter

Re: Feedback: Textpattern CMS 4.9.0 released

id='<txp:yield name="id" />' instead of yield="id" fixed the loss, thank you very much, dear Julian! Yes, I quoted my shortcode ‘figure’, which is inserted into an article as <txp::figure id="123">.

Offline

Board footer

Powered by FluxBB