Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
Re: Feedback: Textpattern CMS 4.9.0 released
The backend: Content: Write: Sort and display — what to sort?

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
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
Re: Feedback: Textpattern CMS 4.9.0 released
Offline
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
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
Re: Feedback: Textpattern CMS 4.9.0 released
Odd. Are they any messages when you switch production mode to Debug in Prefs?
Offline
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
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
Offline
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
trimescape=“tidy,textile” /></figcaption>
<figcaption><txp:yield escape=“tidy,textile” trim /></figcaption>
Thank you again, jacob! The code is poetry!
Offline