Wonderful tip!

Just two points, that were no evident to me:

1. If you use a language plugin, you must change "New tiddler" in the first 
line of your code with the corresponding in you language, or the default 
new tiddler text will be in English.

2. Also if you want to have several templates you need to use different 
titlePrefix for each, or buttons will duplicate, and add a text after 
{{$:/core/images/new-button}} to distinguish the button for each template

El dimecres, 27 maig de 2020 15:55:31 UTC+2, bimlas va escriure:
>
> Dear all,
>
> There was probably a similar solution already, but I just figured it out: 
> I found a simple way to create templates for different tiddler types. For 
> example, in the "Software" tiddlers, display the "website" and "platform" 
> fields, and in the "Song" tiddlers, display "author", "album" and "year" by 
> default so you don't have to remember to enter the "required" fields.
>
> To do this, create the mentioned tiddlers as "New tiddler 
> template: Software" and "New tiddler template: Song" and add the desired 
> fields to them. You can even enter a predefined text if you want to store 
> the data not in fields but in the text of the tiddler itself.
>
> Create a tiddler of any name, add the "$:/tags/SideBarSegment" tag and 
> optionally the "list-before: $:/core/ui/SideBarSegments/tabs" field. The 
> content should be:
>
> <$vars titlePrefix="New tiddler template: ">
>   <$list filter="[search:title<titlePrefix>]">
>     <$button message="tm-new-tiddler" param=<<currentTiddler>> class=<
> <tv-config-toolbar-class>>>
>       {{$:/core/images/new-button}} <$text text={{{ 
> [all[current]removeprefix<titlePrefix>] }}}/>
>     </$button> <br/>
>   </$list>
> </$vars>
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/88ab361f-3e0f-4364-9c2c-5065c4e57d2a%40googlegroups.com.

Reply via email to