Mohammad,

Love this macro. I was wondering how I could use this with dynamic tables 
such that I could say display only 10 rows at a time and page through them.

Thanks,

Damon

On Wednesday, February 24, 2021 at 9:24:53 AM UTC-7 Mohammad wrote:

> 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/0fd476a1-cb6e-420a-9484-e557d9426c63n%40googlegroups.com.

Reply via email to