Re: [Tiki-users] How sort by multiple fields using Sort Control Block

Jean-Marc Libs <[email protected]>
Newsgroups gmane.comp.cms.tiki.user
Message-ID <CA++RN4c9JQFSTn8NZVDDEz8WBP6022v61-ZBfFm4knkdOtgsTw@mail.gmail.com>
Still
  {filter type="trackeritem"}
  {filter field="tracker_id" content="42"}
and
  {filter field="tracker_id" content="42"}
  {filter type="trackeritem"}
do the same because there is no conflict.

whereas
   {sort mode="tracker_field_macchineTipoMacchina_text_asc"}
   {sort mode="tracker_field_macchineNomeMacchina_asc"}
and
   {sort mode="tracker_field_macchineNomeMacchina_asc"}
   {sort mode="tracker_field_macchineTipoMacchina_text_asc"}

would be expected to give different results.

Not that « easier to code » is bad :-)

Cheers,
J-M

On Wed, Jan 13, 2021 at 9:54 AM Jonny Bradley via TikiWiki-users <
[email protected]> wrote:

> Although i'm now arguing against myself, sometimes the plugins work like
> an AND logically, e.g.
>
>   {filter type="trackeritem"}
>   {filter field="tracker_id" content="42"}
>
> etc.
>
> I was mainly thinking a comma deleted list would be easier to code ;)
>
> jb
>
>
>
> > On 13 Jan 2021, at 01:57, Jean-Marc Libs <[email protected]>
> wrote:
> >
> > I agree with Luci about the syntax.
> >
> > The usual behaviour seems to be that commands in LIST plugin overwrite
> the previous conflicting commands
> >
> >   {pagination max="2"}
> >   {pagination max="9999"}
> > means pagination max is 9999 while
> >   {pagination max="9999"}
> >   {pagination max="2"}
> > means pagination max is2
> >
> > So I feel
> >   {sort
> mode="tracker_field_macchineTipoMacchina_text_asc,tracker_field_macchineNomeMacchina_asc"}
> > would be more consistent and less unexpected than
> >    {sort mode="tracker_field_macchineTipoMacchina_text_asc"}
> >    {sort mode="tracker_field_macchineNomeMacchina_asc"}
> >
> > I confirm I've missed being able to have cascading sort orders in LIST
> plugin in the past.
> >
> > Cheers,
> > Jyhem
> >
> > On Wed, Jan 6, 2021 at 5:14 PM luciash via TikiWiki-users <
> [email protected]> wrote:
> >> -1 for this, +1 for jonny's
> >>
> >> the code logic says it would just override the previous sort mode
> >>
> >> luci
> >>
> >>
> >> On 06.01.2021 10:04, Bsfez Tiki via TikiWiki-users wrote:
> >> > Hi,
> >> >
> >> > I agree that :
> >> >
> >> >   {sort mode="tracker_field_macchineTipoMacchina_text_asc"}
> >> >   {sort mode="tracker_field_macchineNomeMacchina_asc"}
> >> >
> >> > Is a kind of more intuitive (tried it 2 month ago to see what it does
> 😂)… may be better to figure the sort order ?
> >> >
> >> > Bernard
> >> >
> >> >> On 5 Jan 2021, at 18:16 , Jonny Bradley via TikiWiki-users <
> [email protected]> wrote:
> >> >>
> >> >> Hi Alessandro
> >> >>
> >> >> Ha! Good question, sadly the answer afaik is no, and coincidentally
> i just (5 minutes ago) shelved the tiny start i had made on adding this
> which i started in November and just haven't managed to get time to do
> it... it's quite a challenge i think!
> >> >>
> >> >> I was thinking the syntax would go more like this:
> >> >>
> >> >>   {sort
> mode="tracker_field_macchineTipoMacchina_text_asc,tracker_field_macchineNomeMacchina_asc"}
> >> >>
> >> >> ...but maybe your way is more elegant :p
> >> >>
> >> >> Add a wish on dev.t.o for it and put me in the "keep informed" field
> and let's see if anyone else thinks it's a good idea?
> >> >>
> >> >> Definitely a missing feature imho ;)
> >> >>
> >> >> jonny
> >> >>
> >> >>
> >> >>
> >> >>> On 5 Jan 2021, at 15:09, Alessandro Martinelli <
> [email protected]> wrote:
> >> >>>
> >> >>> Hi there,
> >> >>>
> >> >>> Is there a way or sorting content by means of "sort" control block
> sorting by more than one value? for example I'd like to execute a first
> sorting based on column A value; than, for each column A value, I'd like
> the content to be further sorted by column B value (hope it'clear).
> >> >>>
> >> >>> My code currently look like this:
> >> >>>
> >> >>> {LIST()}
> >> >>>   {filter field="tracker_id" content="19"}
> >> >>>   {sort mode="tracker_field_macchineTipoMacchina_text_asc"}
> >> >>>   {OUTPUT(template="table")}
> >> >>>     {column label="Macchina" field="macchina"}
> >> >>>     {column label="Tipo" field="tipo"}
> >> >>>   {OUTPUT}
> >> >>>   {FORMAT(name="tipo")}{display
> name="tracker_field_macchineTipoMacchina_text"}{FORMAT}
> >> >>>   {FORMAT(name="macchina")}[Commesse.-.Macchina?itemId={display
> name="object_id"}|{display
> name="tracker_field_macchineNomeMacchina"}]{FORMAT}
> >> >>> {LIST}
> >> >>>
> >> >>> I've tried also in the following way but the result is only the
> second {sort} is applied.
> >> >>>
> >> >>> {LIST()}
> >> >>>   {filter field="tracker_id" content="19"}
> >> >>>   {sort mode="tracker_field_macchineTipoMacchina_text_asc"}
> >> >>>   {sort mode="tracker_field_macchineNomeMacchina_asc"}
> >> >>>   {OUTPUT(template="table")}
> >> >>>     {column label="Macchina" field="macchina"}
> >> >>>     {column label="Tipo" field="tipo"}
> >> >>>   {OUTPUT}
> >> >>>   {FORMAT(name="tipo")}{display
> name="tracker_field_macchineTipoMacchina_text"}{FORMAT}
> >> >>>   {FORMAT(name="macchina")}[Commesse.-.Macchina?itemId={display
> name="object_id"}|{display
> name="tracker_field_macchineNomeMacchina"}]{FORMAT}
> >> >>> {LIST}
> >> >>>
> >> >>> Thank you for your time
> >> >>>
> >> >>> Alessandro
> >> >>>
> >> >>>
> >> >>>
> >> >>> _______________________________________________
> >> >>> TikiWiki-users mailing list
> >> >>> [email protected]
> >> >>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-users
> >> >>>
> >> >>
> >> >>
> >> >> _______________________________________________
> >> >> TikiWiki-users mailing list
> >> >> [email protected]
> >> >> https://lists.sourceforge.net/lists/listinfo/tikiwiki-users
> >> >
> >> >
> >> > _______________________________________________
> >> > TikiWiki-users mailing list
> >> > [email protected]
> >> > https://lists.sourceforge.net/lists/listinfo/tikiwiki-users
> >>
> >>
> >> _______________________________________________
> >> TikiWiki-users mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/tikiwiki-users
> >> _______________________________________________
> >> TikiWiki-users mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/tikiwiki-users
> >
>
>
> _______________________________________________
> TikiWiki-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-users
>

_______________________________________________
TikiWiki-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.