Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: RFC: extracting distinct values
Bloke wrote #340633:
<article::custom section='<txp:section />' fields="thisid, list(brand)" break="" limit="0">...
should build me a unique comma-separated list of custom_5 values from articles in that section.
The intended use is fields="section, list(brand)"
, though this will not remove duplicates.
Since GROUP_CONCAT()
supports DISTINCT
clause, this is easy to add. It makes sense then to sort by brand
too. I wouldn’t like to alter list()
behaviour, so a new syntax is needed. Should it be unique()
or distinct()
or something else?
Offline
Re: RFC: extracting distinct values
etc wrote #340645:
The intended use is
fields="section, list(brand)"
, though this will not remove duplicates.
Oh. So I need section
as well, because I’m filtering by section=
in the tag? Maybe that’s where I was going wrong
I wouldn’t like to alter
list()
behaviour, so a new syntax is needed. Should it beunique()
ordistinct()
or something else?
Either works for me. distinct()
is more SQLish.
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
Offline
Offline