viewtemplates that don't show under certain tiddlers?

59 views
Skip to first unread message

David Gifford

unread,
Jun 17, 2021, 10:01:54 AM6/17/21
to TiddlyWiki

Hi everyone

I have a tiddler tagged $:/tags/ViewTemplate. That makes it show up under all the tiddlers. It has a list-search macro in it, so it adds a search box that filters a list of [all[current]tagging[]].

Is there a way to only make it show up under tiddlers that are also tags? And not be visible under other tiddlers?

Brian Radspinner

unread,
Jun 17, 2021, 12:34:47 PM6/17/21
to TiddlyWiki
Try wrapping the content with this list...

<$list filter="[all[current]tagging[]first[]]">

Stuff to be displayed when a tiddler is a tag

</$list>

Eric Shulman

unread,
Jun 17, 2021, 12:45:34 PM6/17/21
to TiddlyWiki
On Thursday, June 17, 2021 at 9:34:47 AM UTC-7 Brian Radspinner wrote:
Try wrapping the content with this list...
<$list filter="[all[current]tagging[]first[]]">
   Stuff to be displayed when a tiddler is a tag
</$list>

Note that the above use of the $list widget wrapper will change the value of <<currentTiddler>> to the first tagged item.  To prevent this, add a variable="..." to the $list widget, like this:
<$list filter="[all[current]tagging[]first[]]" variable="is_a_tag">
   Stuff to be displayed when a tiddler is a tag
</$list>

The important part is that a variable other than the default "currentTiddler" is being used. The name of the variable doesn't really matter, since it isn't being referenced inside the $list widget. As a convention, I've chosen a variable name that describes the purpose of the filter.

enjoy,
-e

David Gifford

unread,
Jun 17, 2021, 12:58:28 PM6/17/21
to tiddl...@googlegroups.com
Thanks you guys, I can confirm that Eric's fix to Brian's answer was exactly what I needed.
And here is how I feel everytime I get these helpful solutions here:



--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/H8_USaW1klo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/96b7abc2-98f2-4de4-aff5-b991b6fae0a1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages