List tiddlers by lengh and filter them

Hello forum,
I tried to add a selection to limit the output list.

Building the filter depending from selected options:
<$let auswahl={{!!TidText}}{{!!allTid}}{{!!TidOrt}}>

Replacing
<$list filter="[all[tiddlers]] :filter[enlist...

width

<$list filter="[<<auswahl>>] :filter[enlist

will fail:

<$list filter="[<<auswahl>>] :filter[enlist{!!tags}prefix:caseinsensitive<tag1>] :sort:integer:reverse[<currentTiddler>get[text]length[]]" >

What is wrong with the syntax?

Thanks, Stefan

You need single brackets when using a variable in a filter

Sorry @vuk - I didn’t get it.

<<auswahl>> has the correct values: [!has[Draft.of]!is[system]has[erstellt]

Where should I use single brackets in the filter statement?

Thanks, stefan

<$list filter="[<<auswahl>>] :filter[enlist

Here. Inside a filter you need to reference the variable as <auswahl>, just like you reference <currentTiddler>.

See examples of same mistake in the thread I linked above and examples of correct usage with explanation. here Those Pesky Brackets — ...and other wikitext punctuation

I saw, there was a square bracket missing at the end:

grafik

→ fixed it.


This is also not working:

<$list filter="[<auswahl>] :filter[enlist{!!tags}prefix:caseinsensitive<tag1>] :sort:integer:reverse[<currentTiddler>get[text]length[]]">

In this code auswahl content is considered as text, although you probably want the result of the filter instead of the definition of the filter.

Try this (untested):
<$list filter="[subfilter<auswahl>] :filter[enlist{!!tags}prefix:caseinsensitive<tag1>] :sort:integer:reverse[<currentTiddler>get[text]length[]]">

Fred

It works perfect - thanks a lot @tw-FRed!

1 Like