Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Link to last published article
phiw13 wrote #320609:
I suspect lots of my initial confusion comes from the word
latestwhich is something quite specific in the date / time space. I saw it as a specific keyword that was not listed in the possible values, whereas it is, in the example above, just a random string.
True. If you can think of a better adjective for use in the example, I’ll amend it.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Link to last published article
Bloke wrote #320610:
True. If you can think of a better adjective for use in the example, I’ll amend it.
Let me sleep over it, I’ll try to think something. It is late now.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: Link to last published article
Bloke wrote #320605:
And, yes, from 4.8.0 jakob is right that
<txp:article_custom>will be able to read in URL variables directly so you can do crazy filtering via custom field values or whatever. A boon for sites that offer browsing via article CFs (e.g. an estate agency site that reveals front-end select lists for number of rooms, location, property type, etc). Just add those params to the query payload and you can pass them straight through to<txp:article_custom>.
You can even alias them via match="cf_name=url_name" attribute, for extra flexibility.
Offline
Re: Link to last published article
gilibaus wrote #320575:
I publish a new article every week and all of them belong to the same section. I need a single URL that always points to the last published individual article in that section. Any hint? Thanks.
A bit more 4.7-ish: in Advanced options create a html custom form type with mediatype="text/html". Then create a latest form of html type:
<txp:article limit="1">
<txp:header name="Location" value='<txp:permlink />' />
</txp:article>
Now each hit of /section/?f=latest URL should 302-redirect you to the latest article.
Offline
Re: Link to last published article
Bloke wrote #320610:
True. If you can think of a better adjective for use in the example, I’ll amend it.
How about “most-recent” ? More string like while still saying latest, and for an international audience still has an easy reference point.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: Link to last published article
phiw13 wrote #320617:
How about “most-recent” ? More string like while still saying latest, and for an international audience still has an easy reference point.
oldest / newest ?
…. texted postive
Offline
Re: Link to last published article
I’ve updated the example to use ‘most-recent’ and added Oleg’s example for completeness. Not sure it’s quite the right place for it in the tag doc, as it’s really showing off a shortcode, but we can move it if necessary when we decide what to do with the shortcodes doc.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline