tweaking draggable list with filter

54 views
Skip to first unread message

Dave Parker

unread,
May 19, 2020, 5:30:30 PM5/19/20
to TiddlyWiki
Hi,

I'm trying to add a little indication to items in a draggable list to have the word "done" beside the item but only if that tiddler has a tag "done"

This seems to add "done" to every item in the list, regardless of whether its tagged done or not:

template tiddler:

[[draggableTemplate1]]
<$link to={{!!title}}>{{!!title}}<$list filter="$(currentTiddler)$tag[done]"> @@color:beige;^^done^^@@</$list></$link>

list (macro) tiddler:
\define tgngd()
^^(draggable)^^

<<list-tagged-draggable tag:"$(currentTiddler)$" itemTemplate:"draggableTemplate1">>

\end
<<tgngd>>

in the template tiddler I've also tried:
<$list filter="title[{{!!title}}]tag[done]">
<$list filter="all[current]tag[done]">
<$list filter="<<currentTiddler>>tag[done]">

Any suggestions?

thanks,
- Dave

Eric Shulman

unread,
May 19, 2020, 5:43:25 PM5/19/20
to TiddlyWiki
On Tuesday, May 19, 2020 at 2:30:30 PM UTC-7, Dave Parker wrote:
I'm trying to add a little indication to items in a draggable list to have the word "done" beside the item but only if that tiddler has a tag "done"
This seems to add "done" to every item in the list, regardless of whether its tagged done or not:
[[draggableTemplate1]]
<$link to={{!!title}}>{{!!title}}<$list filter="$(currentTiddler)$tag[done]"> @@color:beige;^^done^^@@</$list></$link>

list (macro) tiddler:
\define tgngd()
^^(draggable)^^

<<list-tagged-draggable tag:"$(currentTiddler)$" itemTemplate:"draggableTemplate1">>

\end
<<tgngd>>

Try this: 
<$link to={{!!title}}>{{!!title}}<$list filter="[<currentTiddler>tag[done]]"> @@color:beige;^^done^^@@</$list></$link>

notes:
* the filter syntax needs an outer enclosing pair of square brackets
* within filters, references to variables (e.g., <currentTiddler>) use only *single* angle brackets

enjoy,
-e



Dave Parker

unread,
May 19, 2020, 9:13:02 PM5/19/20
to TiddlyWiki
Thanks Eric!

For some reason I'd gotten it in my head that when a filter is in quotes the outer brackets are not needed, 
and I'd either forgotten or never learned about the single bracket <currentTiddler>

TonyM

unread,
May 20, 2020, 12:00:41 AM5/20/20
to TiddlyWiki
Dave

Almost the opposite is true

Filter={{filtertiddler}}

Regards
Tony

Dave Parker

unread,
May 20, 2020, 12:41:00 AM5/20/20
to TiddlyWiki
Tony, I don't think I'm as clever as you think I am...

Filter={{filtertiddler}}


could you elaborate on what that means? 

Mat

unread,
May 20, 2020, 12:41:41 AM5/20/20
to TiddlyWiki
Reply all
Reply to author
Forward
0 new messages