Apply a template to all tiddlers

233 views
Skip to first unread message

kash....@gmail.com

unread,
Nov 28, 2018, 2:05:24 PM11/28/18
to TiddlyWiki
Is there any way to apply a template to all/multiple tiddlers in a wiki?

This is probably a simple question but I can't seem to find any related documentation or previous questions.

For example say I want a list at the top of every tiddler that shows all tagged tiddlers. Is there a way apply the following template to every tiddler in my wiki?

<$list filter="[tag<currentTiddler>]">

</$list>


Thanks for your help!

Dave

unread,
Nov 28, 2018, 2:59:50 PM11/28/18
to tiddl...@googlegroups.com
This is mine I use a lot (similar idea)

<<list-links filter:"[all[current]tagging[]]">>

put that in a tiddler, and tag it with $:/tags/ViewTemplate 


But doing the same with your own code should also work

Dave

unread,
Nov 28, 2018, 3:04:23 PM11/28/18
to TiddlyWiki
Here's a similar one I use that sorts the tagged items by the field "priority"
\define tgngp()
<table>
<$list filter="[all[current]tagging[]!tag[exclude]!tag[done]has[priority]sort[priority]limit[20]]">
<tr>
<td><$link to={{!!title}}><$view field="title"/>
</$link></td>
<td><$view field="priority" /></td>
<td><$range tiddler={{!!title}} field="priority" min="0" max="0.20" default=".01" increment=".01"/></td>
</tr>
</$list>
<$list filter="[all[current]tagging[]!has[priority]]">
<tr>
<td><$link to={{!!title}}><$view field="title"/>
</$link></td>
<td><$view field="priority" /></td>
</tr>
</$list>
</table>
\end

but that's put in a macro.  You can take the stuff between the \define tgngp(), and \end and do the same as described above


TonyM

unread,
Nov 28, 2018, 5:45:24 PM11/28/18
to TiddlyWiki
Dave,

I imagin placing <<tgngp>> in a tiddler tagged view template would work as well?

In which case I would be tempted to also limit when it is displayed eg

<$list filter="[all[current]!is[system]]">
<<tgngp>>
</$list>

This will only show on non system tiddlers. But you could have multiple tests and content to build rich content on tiddlers.

Regards
Tony

bimlas

unread,
Nov 29, 2018, 1:54:06 AM11/29/18
to TiddlyWiki
I attached my solution, it puts two "tag-pill" like lists on top of all tiddlers, those listing the same titles as tiddlerinfo tagging and references tabs.

vivaldi_2018-11-29_07-51-34.png


You can try out on https://bimlas.gitlab.io/
informational-tag-pills.json

Mohammad

unread,
Nov 29, 2018, 2:25:20 AM11/29/18
to TiddlyWiki
Wonderful Bimlas!

kash....@gmail.com

unread,
Nov 30, 2018, 7:24:37 PM11/30/18
to TiddlyWiki
Bimlas that is great thank you for sharing it!

Thank you Dave that is the kind of thing I was looking for. Is there a system tag that will the template at the top of the tiddler, or another way to do this?


TonyM

unread,
Nov 30, 2018, 10:48:32 PM11/30/18
to TiddlyWiki
Bimlas,

Thanks for this. A tidy version of the tagging tag pill I love using, and great to see references as well.

If your wanted a little inspiration, that you gave me, I was thinking what if we also had a "Fields" tagpil look alike, from which you can select from the fields on the current tiddler, on selecting a field it could open a  special tiddler/popup that has knowledge of both the tiddler you selected the field from, and the field name. It could then present an editor to edit that field.

Thanks again for your work,
Regards
Tony

bimlas

unread,
Dec 1, 2018, 5:01:09 PM12/1/18
to TiddlyWiki
@kash: I think `$:/tags/ViewTemplate` is what you looking for; for example my solution is using this tag with `list-after: $:/core/ui/ViewTemplate/tags` field.

bimlas

unread,
Dec 1, 2018, 5:53:23 PM12/1/18
to TiddlyWiki
@TonyM: To avoid misunderstandings: this is what you like to achieve?


vivaldi_2018-12-01_23-37-32.png


If yes, then see the modified version of the tiddlers in the attachment. Basically, it's just a transclusion of the Fields tab of TiddlerInfo. If you want to change the fields, 2click2edit makes it easy to switch to edit mode, where you can edit the fields.
informational-tag-pills-with-fields.json

bimlas

unread,
Dec 1, 2018, 6:03:08 PM12/1/18
to TiddlyWiki

It seems that these "tag-pills" are virtually the same as a "semi-collapsed" TiddlerInfo: It might be better to modify TiddlerInfo to show only the tabs list by default, but this should be always visible.


vivaldi_2018-12-02_00-01-34.png



TonyM

unread,
Dec 1, 2018, 7:31:44 PM12/1/18
to TiddlyWiki
Bimlas,

Some English support Choosed is not a word, Use Chose for having made a choice in the past. It is one of the cases where adding "ed" does not work, because choose is either present or future tense already, so saying "to choose now or in the future and adding in the past with ed" just does not work. I empathise with the complexity of learning English, although it is my mother tongue.

On the fields pill yes, that is almost what I am saying but perhaps so we can also edit them. 

I suggest you not spend too much time on this, it will eventually pay off, but there are some complicating issues. In a solution of my own not (yet) published, called edit fields, I have a method of editing fields on the current tiddler, but in this case I use another field on each tiddler to show which fields and in what order to list in this edit mode. It also draws on a definition tiddler to identify how to display/edit particular fields like icon, colour or text.

If you want to pursue this, I suggest together we do a little design work first, Identify the goal and how best to achieve it.

Regards
Tony

bimlas

unread,
Dec 4, 2018, 2:01:58 AM12/4/18
to TiddlyWiki
Thanks for the English lesson. :) Since I'm not going to school anymore and I do not have people speaking English and Hungarian in my environment, so my English knowledge does not really improve. Maybe once I enroll in a language school, but I'm relying on Google Translate for now when I'm not too lazy to use it.

Your solution seems more sophisticated and I am not so interested in using the fields, so if you do not mind, I leave this job to you.

TonyM

unread,
Dec 4, 2018, 6:59:56 AM12/4/18
to TiddlyWiki
Bimlas,

Fine with me, thanks anyway.

Tony

Reply all
Reply to author
Forward
0 new messages