How to apply a template to every tiddler with a certain tag?

122 views
Skip to first unread message

si

unread,
Aug 29, 2019, 7:13:10 PM8/29/19
to TiddlyWiki
Hi there

As per the title, I am trying to apply Template1 to every tiddler tagged "tag1" and Template2 to every tiddler tagged "tag2".

I am aware that a template tagged $:/tags/ViewTemplate will apply to all tiddlers in the wiki, but I can't figure out anything beyond that?

Any help would be much appreciated.

Thanks in advance

Mark S.

unread,
Aug 29, 2019, 7:53:46 PM8/29/19
to TiddlyWiki
<$list filter="[all[current]tag[tag1]]">
Your template text here
</$list>

Aidan Grey

unread,
Aug 30, 2019, 11:53:30 AM8/30/19
to tiddl...@googlegroups.com
Can a template be applied after the tiddler is created, without transclusion? That doesn't seem possible...

Anyone know?

--
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 tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6afffc4d-9308-4cfb-bf0d-7540d9fc92e8%40googlegroups.com.

TonyM

unread,
Aug 30, 2019, 11:21:04 PM8/30/19
to TiddlyWiki
Adian,

Using the view template tag like Mark suggested - with his conditional test will show on any tiddler matching his condition.

  • In many ways this is a template applied after the tiddler is created.
  • Perhaps you are thinking about a template to pre-populate the text field?
    • A subsequent application of a text field template would overwrite the existing text field yes.
  • View templates are telling tiddlywiki what to display when viewing a tiddler
    • You can make tiddler fields visible on the view template
    • You can introduce other content, buttons and links and more
  • You could have the text field contain a transclusion of another tiddler (a template) to do something similar to the view template in that tiddler alone
    • But the text field must contain this transclusion
    • The view template allows you to overlay the view of the tiddler with what every you want and keep the text field free for text content
  • You may be interested to know in a recent tiddlywiki app I made the text field is a purely optional "note" field and is often empty. All the tiddlers specific details are stored in fields and made visible through the view template.
Regards
Tony
Does that help?


On Saturday, August 31, 2019 at 1:53:30 AM UTC+10, Aidan Grey wrote:
Can a template be applied after the tiddler is created, without transclusion? That doesn't seem possible...

Anyone know?

On Thu, Aug 29, 2019, 5:53 PM 'Mark S.' via TiddlyWiki, <tiddl...@googlegroups.com> wrote:
<$list filter="[all[current]tag[tag1]]">
Your template text here
</$list>

On Thursday, August 29, 2019 at 4:13:10 PM UTC-7, si wrote:
Hi there

As per the title, I am trying to apply Template1 to every tiddler tagged "tag1" and Template2 to every tiddler tagged "tag2".

I am aware that a template tagged $:/tags/ViewTemplate will apply to all tiddlers in the wiki, but I can't figure out anything beyond that?

Any help would be much appreciated.

Thanks in advance

--
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 tiddl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages