Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: latest article per author
Bloke wrote #334268:
So do we need to add a column to indicate a field is to be ‘hidden’ or ‘internal’ or something like that? Or can we use one of the existing status fields in the meta table to differentiate? Not sure we want such fields to pop up in the UI.
Absolutely, they are queries rather than raw values and must be hidden in Write UI. They would only be accessible on meta tab and have no content_id
(or content_id = -1
?), but I’d leave the storage implementation with you :-)
We actually already have such a virtual field in txp: score
of search queries. Its value is used for sort only and is not accessible otherwise. New virtual cf computed value would be available on the public side for filtering/sorting/output like for any other cf.
Offline
Re: latest article per author
Bloke wrote #334269:
We’re kind of thinking that 4.9 (dev branch, as of now) will be the next version. Like, in a few weeks. Unless we can find a way to talk ourselves out of it.
You could still label 4.9 as the last MySQL5.x compatible version – and the last PHP 5.x version. Broadcast it, and then Texpattern.next (Textpattern 5.0, CF branch?) can go full speed ahead with some of those interesting goodies. And release 4.9 as scheduled in a couple of weeks.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: latest article per author
Finally, some SQL window functions abilities have been implemented in dev
for MySQL 8+ (or similar) users:
<!-- OP question: retrieve the most recent article for each author -->
<txp:article_custom fields="*, rank[authorid](posted desc)" $posted="1" sort="AuthorID" />
<!-- Three random articles per author -->
<txp:article_custom fields="*, authorid, rank[*](*)" sort="RAND()" $rank="%%3" />
It’s not the happiest syntax ever, but, hopefully, this will be much easier in cf branch.
Offline