Hide text if list is empty ??

81 views
Skip to first unread message

Tony K

unread,
Apr 28, 2020, 12:49:08 PM4/28/20
to TiddlyWiki
Probably a basic question

//see also//: {{{ [list[!!keywords]] || $:/core/ui/TagTemplate }}}


this is to return all keywords in the "keywords" field and add them like a "ViewTemplate"

however I don't want to show "see also" if the "keywords" field is empty

is there a way to do that?

thank you  

Mat

unread,
Apr 28, 2020, 1:02:06 PM4/28/20
to TiddlyWiki
(I agree but...).

The way to do it is to use two lists with the same filter but a "+[first[]]" operator for the headline:

<$list filter="my filter +[first[]]">
 My headline
</$list>
<$list filter="my filter">

</$list>

<:-)

Tony K

unread,
Apr 28, 2020, 1:06:42 PM4/28/20
to TiddlyWiki
Thank you Mat so much 

but how can I filter based on a keywords field ? 

sorry trying to learn 

Mat

unread,
Apr 28, 2020, 2:53:41 PM4/28/20
to TiddlyWiki
Nothing to be sorry about.

but how can I filter based on a keywords field ? 

In your OP you write [list[!!keywords]] . See if this works instead: [enlist{!!keywords}]

because I suspect you want to transclude the values (from the current tiddler) and enlist them. 

<:-)

Tony K

unread,
Apr 28, 2020, 4:20:02 PM4/28/20
to TiddlyWiki
wow thank you Matt that actually worked :D

Thank you so much 

TonyM

unread,
Apr 28, 2020, 9:13:56 PM4/28/20
to TiddlyWiki
Tony K,

Just for fun this may be an approach, especialy if you do turn your keywords into tags, they could all be themselves tagged "See also"

{{{ [[See also]] [all[current]enlist{!!keywords}] || $:/core/ui/TagTemplate }}}

Tiddlywiki is so fun.

Regards
tony
Reply all
Reply to author
Forward
0 new messages