Hello Mohammad, Exactly, I want to refine the search result. (Useful when the filter returns a lot of matches). Thank you for having a look at it.
Best regards, Eskha Le jeudi 25 février 2021 à 10:08:55 UTC+1, Mohammad a écrit : > Hi Eskha > > I got your point! You want to refine the search result! > I created an issue https://github.com/kookma/TW-Shiraz/issues/16 to look > at this and hopefully add the feature to Shiraz! > > > Best wishes > Mohammad > > > On Thu, Feb 25, 2021 at 11:16 AM Eskha <[email protected]> wrote: > >> Thank you Mohammad for your answer. >> >> I can confirm that it is working on TiddlyWiki. >> >> However it is not exactly the behavior I was expecting. >> Indeed when using the list-search macro, the filter option is different >> from the text input. >> You define the filter in the macro-call, for instance >> "[tag[Definitions]]" (or use default filter "[tags[]]"). >> Then, the text you write into the text input narrow down the search to >> the filtered titles matching the text input. >> For instance (on Tiddlywiki.com) with the filter option >> "[tag[Definitions]]" and the text "URI", you would only see two elements in >> the list: Data URI and URI. >> In your use-case, the text input is replacing the filter option. >> >> For other, I add a link to your well explained "demo/list-search-macro" >> tiddler: >> Shiraz 2.1.2 — extended markups: styles, macros, images, tables >> (kookma.github.io) >> <https://kookma.github.io/TW-Shiraz/#demo%2Flist-search-macro> >> >> To summarize, what would be my "ideal" behavior would be that an optional >> "entries-per-page" attribute exists in list-search! >> >> Best regards, >> >> Eskha >> >> >> >> >> >> Le mercredi 24 février 2021 à 17:24:53 UTC+1, Mohammad a écrit : >> >>> Eska, >>> >>> In tiddlywiki.com give a try for the code below. I assume you have you >>> have already the list-pages working in tiddlywiki.com >>> >>> \define list-search-pages() >>> <$edit-text >>> tiddler="some-tiddler" >>> type="search" >>> tag="input" >>> default=""/> >>> >>> ><$macrocall $name=list-pages filter={{some-tiddler}} >>> entries-per-page=10 /> >>> \end >>> >>> Then enter in the edit box something like this: [tag[Definitions]] >>> >>> >>> Best wishes >>> Mohammad >>> >>> >>> On Wed, Feb 24, 2021 at 6:41 PM Eskha <[email protected]> wrote: >>> >>>> Hello Mohammad, >>>> >>>> Thank you for this useful macro. >>>> >>>> I was wondering if it was possible to integrate it with Tobias >>>> list-search macro (see below) since it would be a very powerful >>>> combination? >>>> >>>> Best regards, >>>> >>>> Eskha >>>> >>>> >>>> \define list-search( >>>> filter:"[tags[]]", >>>> search:"search:title", >>>> state:"$:/temp/list-search", >>>> template:"$:/core/ui/ListItemTemplate", >>>> placeholder:"Filter", >>>> limit:100000 >>>> ) >>>> <div> >>>> <$edit-text >>>> tiddler="$state$" >>>> type="search" >>>> tag="input" >>>> default="" >>>> placeholder="$placeholder$"/> >>>> </div> >>>> >>>> <$reveal state="$state$" type="match" text=""> >>>> <$list filter="$filter$+[limit[$limit$]]" template="$template$"/> >>>> </$reveal> >>>> >>>> <$reveal state="$state$" type="nomatch" text=""> >>>> <$list filter="$filter$+[$search${$state$}]+[limit[$limit$]]" >>>> template="$template$"/> >>>> </$reveal> >>>> \end >>>> >>>> >>>> Le mercredi 24 février 2021 à 13:28:07 UTC+1, Mohammad a écrit : >>>> >>>>> In the call to *qualify *the xx$/state is used on purpose to see the >>>>> stateTid >>>>> Remove xx after test! >>>>> >>>>> Best wishes >>>>> Mohammad >>>>> >>>>> >>>>> On Wed, Feb 24, 2021 at 3:55 PM Mohammad Rahmani < >>>>> [email protected]> wrote: >>>>> >>>>>> I have developed a* list-pages* macros similar to list-links, but it >>>>>> is a little lengthy >>>>>> >>>>>> \define list-pages(filter, entries-per-page:5, template, >>>>>> stateTid:"pagingTid") >>>>>> <$vars stateTid=<<qualify xx$/state/$stateTid$>> > >>>>>> <$vars total-entries={{{ [subfilter<__filter__>count[]] }}} >>>>>> page-number={{{[<stateTid>get[text]] ~[[1]]}}} > >>>>>> <$vars >>>>>> low={{{[<page-number>subtract[1]multiply<__entries-per-page__>]}}} >>>>>> high={{{[<page-number>multiply<__entries-per-page__>]}}} > >>>>>> >>>>>> <!-- create nav buttons ---> >>>>>> <$list filter="[<page-number>compare:number:lt[2]then[yes]else[no]]" >>>>>> variable=state> >>>>>> <$button disabled=<<state>> >Prev >>>>>> <$action-listops $tiddler=<<stateTid>> $field=text >>>>>> $subfilter="+[subtract[1]] ~[[1]]"/> >>>>>> </$button> >>>>>> </$list> >>>>>> <$list >>>>>> filter="[<high>compare:number:gteq<total-entries>then[yes]else[no]]" >>>>>> variable=state> >>>>>> <$button disabled=<<state>>>Next >>>>>> <$action-listops $tiddler=<<stateTid>> $field=text >>>>>> $subfilter="+[add[1]] ~[[2]]"/> >>>>>> </$button> >>>>>> </$list> >>>>>> >>>>>> Displaying <$text text={{{[<low>add[1]]}}}/> through <<high>> of >>>>>> <<total-entries>> Results >>>>>> >>>>>> <$list filter="[subfilter<__filter__>first<high>] >>>>>> -[subfilter<__filter__>first<low>]" template=<<__template__>> /> >>>>>> >>>>>> </$vars> >>>>>> </$vars> >>>>>> </$vars> >>>>>> \end >>>>>> >>>>>> >>>>>> It accepts: >>>>>> * any Tiddlywiki filter or filter combinations >>>>>> * it accepts template (so it is very powerful in creating different >>>>>> outputs >>>>>> * can be used in a tiddler several times (has stateTid) >>>>>> * number of output per page can be set >>>>>> >>>>>> This macro can be hacked and used for situations where you have too >>>>>> many outputs. Paging prevents a long output and hence slows down TW >>>>>> performance! >>>>>> >>>>>> *Evaluations* >>>>>> To give a try, download attached JSON and drag and drop into >>>>>> https://tiddlywiki.com/ >>>>>> Look at the Test tiddler >>>>>> As an example a simple template was created for test purposes. >>>>>> >>>>>> *Question:* >>>>>> What simpler solution do you propose? >>>>>> What improvement do you suggest? >>>>>> >>>>>> >>>>>> Best wishes >>>>>> Mohammad >>>>>> >>>>> -- >>>> >>> You received this message because you are subscribed to the Google >>>> Groups "TiddlyWiki" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/tiddlywiki/24fce8f6-f523-4cb4-b54f-9027b04b4c23n%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/tiddlywiki/24fce8f6-f523-4cb4-b54f-9027b04b4c23n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "TiddlyWiki" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/tiddlywiki/4efce6e2-15fd-43ba-8e52-4cc7322a9dbcn%40googlegroups.com >> >> <https://groups.google.com/d/msgid/tiddlywiki/4efce6e2-15fd-43ba-8e52-4cc7322a9dbcn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/cc050379-fca2-4309-97c8-ce7a50d02921n%40googlegroups.com.

