Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [Solved] Ugly code: how to improve it?
etc wrote #335269:
But this does not feel very clean, so a new
<txp:date />
tag would be better, perhaps?
I would support that, rather that overloading an attribute.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: [Solved] Ugly code: how to improve it?
For you interest. Finally, based on this post by Bloke (see here), I use the new feature to associate some PHP functions (strtotime,date
) to the <txp:evaluate /> tag.
Devs, do you think that’s a good approach?
<txp:variable name="now" value='time()' />
<txp:article_custom section="my-section" time="future" limit="1" precommande sort="LastMod desc">
<txp:evaluate query='strtotime(date("Y-m-d", strtotime("-5 days", <txp:posted format="%s" />))) <= <txp:variable name="now" escape="integer" />'>Hurry up!</txp:evaluate>
</txp:article_custom>
Last edited by Pat64 (2023-07-26 09:47:53)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline