Hi, And here comes the last and final version. I've tested it, and it seems that BOLTmultidisplay could be used as a replacement for BOLTdisplay, also in BOLTFlist and BOLTFinfo (although I could see the point of a BOLTFmultilist, but quite not for BOLTFmultiinfo).
What I have done is much more than just "multisearch", since the search
function is basically changed only in the name of the functions it calls
for displaying results. I have merged BOLTdisplayTemplate and
BOLTdisplayFmt (avoid duplicate code while keeping the distinction between
the two ways of processing, of course), changed the meaning of the "if"
parameter to restrict running of the function instead of returned results
(since the when parameter does that, now; and so the if parameter behaves
like in all other functions), and added a piece of code that splits the
when and the template or fmt parameter in order to give the expected result.
But I guess that if this were to be incorporated into the core of Boltwire
(as an extension of how templates currently work, not just a multisearch
function), this would better come with the release of version 5, since the
change of meaning of the "if" parameter could break websites (and even
though you don't expect that for every new release, you are anyway aware
this may happen of version change). Maybe functions using the "old/current"
formatting process could be marked as deprecated, and new ones could be
introduced that use what I propose here, but I think it would be stupide to
deprecate search in order to replace it by multisearch.
The following lines of code indeed produce the same result:
- [(search group=some.page if='equal {+:somevar} something' fmt='default')]
- [(multisearch group=some.page when='equal {+:somevar} something'
fmt='default')]
But now, you can do the following:
- [(multisearch group=some.page if='ingroup somepeople' when='equal
{+:somevar} something' fmt='default')]
Cheers,
Tiffany/Maelite
Le jeudi 12 mars 2015 17:35:40 UTC+1, mz a écrit :
>
> Thank you very much! This would be handy in my next projects.
>
> Greetings, Martin
>
> Am Montag, 9. März 2015 13:05:16 UTC+1 schrieb Tiffany Grenier:
>>
>> ... and I kept my promise.
>> I removed the "classification" parameter and added a "substr" function,
>> so the previous examples would become the following ones:
>> <(multisearch group={p}.* if='! equal {+:cat} date' when='inlist
>> list="{+:cat}" item="logement"|inlist list="{+:cat}" item="bureau"|true'
>> template='subpageslistlog|subpageslistbur|subpageslist' count=false
>> type=-{zones})>
>> [(multisearch
>> group=character.apc.+,character.npc.+,character.pc.+.+,character.epc.+.+
>> sort="{+:birthlastname} {+:birthfirstname}" type=-{zones} template="[if new
>> {(substr {+:birthlastname} 0 1)}]<(substr {+:birthlastname} 0
>> 1)>\n[if][[{+p}|+]] : {+:birthlastname} {+:birthfirstname}" count=false)]
>> [(multisearch
>> group=character.apc.+,character.npc.+,character.pc.+.+,character.epc.+.+
>> sort="{+:birthdateyear} {+:birthlastname} {+:birthfirstname}" type=-{zones}
>> template="[if new {+:birthdateyear}]{+:birthdateyear}\n[if][[{+p}|+]] :
>> {+:birthlastname} {+:birthfirstname}" count=false)]
>> [(multisearch group=jeu.* when='inlist list="{+:cat}"
>> item="logement"%inlist list="{+:cat}" item="bureau"'
>> template='optionhome%optionwork' whensep='%' count=false type=-{zones})]
>>
>> Enjoy!
>>
>> Le vendredi 27 février 2015 09:01:34 UTC+1, Tiffany Grenier a écrit :
>>>
>>> Hi,
>>> I think I will remove the classification parameter, as it sometimes
>>> seams buggy and even better results can be achieved by using the "new"
>>> condition I just discovered, althought I'll then have to provide a waytto
>>> check for the novelty based on the first letter or character to be able to
>>> do the exact same.
>>> Something great will alo to add a "sortunique" parameter or a "unique"
>>> flag.I hope I can come back soon with these features.
>>> Cheers,
>>> Tiffany, alias Maelite/Mélité
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/d/optout.
<<attachment: multisearch.php>>
