Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2025-12-26 22:20:23

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,131
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 Yesterday 07:31:33

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 326
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

#51 Yesterday 13:12:59

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

Re: Feedback: Textpattern CMS 4.9.0 released

The backend: Content: Write: Sort and display — what to sort?

Textpattern: just write

Perhaps it would be more appropriate to ask: “How and where to display”? Or, avoiding the question: “Destination”.

The last collapsing option was “Ten last editetd articles” — is it removed or just invisible for me?

Offline

#52 Yesterday 14:04:02

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,303
Website GitHub

Re: Feedback: Textpattern CMS 4.9.0 released

Vienuolis wrote #341993:

Sort and display — what to sort?

There is one other option that appears if your settings allow it (override form). And I guess you are “sorting” the articles into sections. But maybe the group could be slightly better named in Txp 5.

The last collapsing option was “Ten last editetd articles” — is it removed or just invisible for me?

It’s been removed but wet has a plugin that restores it


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#53 Yesterday 15:17:20

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,397
Website GitHub Mastodon

Re: Feedback: Textpattern CMS 4.9.0 released

Bloke wrote #341994:

…but wet has a plugin that restores it

See wet_quickopen.

Offline

#54 Yesterday 15:25:42

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

Re: Feedback: Textpattern CMS 4.9.0 released

I tried everything I could think of, but I could not clean up the extra empty lines by pulling the image caption from an images panel into ‹figcaption›:

 	<figure>
<img src="https://my.domain/images/123.png" alt="description" width="660" height="440"> 
<figcaption>Long description

</figcaption> 
	</figure>

instead of former

 	<figure>
<img src="https://my.domain/images/123.png" alt="description" width="660" height="440"> 
<figcaption>Long description</figcaption> 
	</figure>

Not a flaw, though… Code is poetry!

Last edited by Vienuolis (Yesterday 15:39:32)

Offline

#55 Yesterday 16:25:24

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

Re: Feedback: Textpattern CMS 4.9.0 released

See wet_quickopen.

Thanks, dear Robert! I installed both plugins, switched Active: No to Yes, and left the default Order: 5. Oddly, the additional option for Recent articles did not appear, even though there were no warnings. And after disabling script blockers, and using other browsers.

Offline

#56 Yesterday 16:36:18

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,397
Website GitHub Mastodon

Re: Feedback: Textpattern CMS 4.9.0 released

Odd. Are they any messages when you switch production mode to Debug in Prefs?

Offline

#57 Yesterday 17:11:56

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

Re: Feedback: Textpattern CMS 4.9.0 released

wet wrote #341998:

Odd. Are they any messages when you switch production mode to Debug in Prefs?

No related to your plugins, only for an outdated one:

tru_tags (3.9.2) -> 8192: Creation of dynamic property tru_tags_pref::$name is deprecated on line 999…

Offline

#58 Yesterday 17:52:07

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

Re: Feedback: Textpattern CMS 4.9.0 released

Vienuolis wrote #341996:

I tried everything I could think of, but I could not clean up the extra empty lines by pulling the image caption from an images panel into ‹figcaption›:

It’s probably the extra formatting from textiling. Try this:

<figure<if::yield name="class"> class="<txp:yield name='class' />"</if::yield>>
    <txp:image id='<txp:yield name="id" />' loading="lazy" />
    <txp:if_yield>
        <txp:yield escape="p,tidy,textile" wraptag="figcaption" trim />
    <txp:else />
        <txp:image_info id='<txp:yield name="id" />' escape="p,tidy,textile" wraptag="figcaption" trim />
    </txp:if_yield>
</figure>

This just adds the trim attribute and an extra p in the escaping to drop the p wrapper-tag produced by textile.

For absolute code-output OCD with no blank lines, you could wrap the entire figcaption output in a variable that you also trim and output in place:

<figure<if::yield name="class"> class="<txp:yield name='class' />"</if::yield>>
    <txp:image id='<txp:yield name="id" />' loading="lazy" />
    <txp:variable name="figcaption" output trim>
    <txp:if_yield>
        <txp:yield escape="p,tidy,textile" wraptag="figcaption" trim />
    <txp:else />
        <txp:image_info id='<txp:yield name="id" />' escape="p,tidy,textile" wraptag="figcaption" trim />
    </txp:if_yield>
    </txp:variable>
</figure>

but as you say, it has no relevance for the page output itself.


TXP Builders – finely-crafted code, design and txp

Offline

#59 Yesterday 18:04:04

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,397
Website GitHub Mastodon

Re: Feedback: Textpattern CMS 4.9.0 released

In reply to Vienuolis #341999:

We’d rather not hijack this thread for plugin support issues. If you want to, please add a message here.

Offline

#60 Yesterday 20:41:48

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

Re: Feedback: Textpattern CMS 4.9.0 released

Yes! p does not seem necessary, but trim appears to be essential.

It is also noteworthy that trim does not work before escape, only after:

<figcaption><txp:yield trim escape=“tidy,textile” /></figcaption>

<figcaption><txp:yield escape=“tidy,textile” trim /></figcaption>

Thank you again, jacob! The code is poetry!

Offline

Board footer

Powered by FluxBB