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

Alessandro Martinelli <[email protected]>
Newsgroups gmane.comp.cms.tiki.user
Message-ID <[email protected]>
Hi,

actually in the documentation 
(http://doc.tiki.org/PluginList-sort-control-block) there's an example 
where a random sorting can be achieved by means of

{sort mode="randommode" 
modes="title_asc,tracker_field_example_asc,tracker_field_ticketNumber_nasc, 
modification_date_nasc"}

where it picks automatically *one of* the listed fields.

Thus I thought maybe even a

{sort mode="???" modes="firstSortingField,secondSortingField,..."}

could be consistent with how things work now ("???" could be 
multipleFieldSorting or something like that)

But I'm no expert of the matter of course, so I'll leave this to others 
who know better :)

@Jonny Ok, I'll add a wish.

Regards,

Alessandro

Il 06/01/2021 17:13, luciash via TikiWiki-users ha scritto:
> -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
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.