Mohammad, Eric and Mats answers are what I use too, If I had shared a tiddler rather than in my reply, it would normally have a list-before or list-after field in it, if it belongs somewhere specifically, otherwise it placement is something I decide.
The Quick and easy way is drag and drop on the $:/tags/ViewTemplate tag pill, also easy to create with `<<tag "$:/tags/ViewTemplate">>` Regards Tony On Wednesday, January 29, 2020 at 3:15:52 PM UTC+11, Mohammad wrote: > > Hi Tony, > > How one can set the order of elements added to a tiddler through > ViewTemplates? > > The below script when is used with https://tiddlywiki.com/prerelease/ causes > to have the TOC > at most bottom of tiddler and the Comment tool above TOC, but I think TOC > should be appeared before Comment element > > --Mohammad > > On Wednesday, January 29, 2020 at 3:04:35 AM UTC+3:30, TonyM wrote: >> >> Folks, >> >> I have another approach, test this on TiddlyWiki.com >> >> Create a tiddler containing this and tag with $:/tags/ViewTemplate >> \define default-toc-here() >> <h4>Optional TOC here</h4> >> <$list filter="[tag<currentTiddler>limit[1]]" emptyMessage="//nothing >> tagged with <<currentTiddler>>//" variable=nul > >> <$macrocall $name="toc-selective-expandable" tag=<<currentTiddler>> > >> </$list> >> \end >> <$list filter="[all[current]has:field[toc-here]]" variable=nul> >> <$list filter="[all[current]get[toc-here]]" variable=toc-tiddler >> emptyMessage=<<default-toc-here>> > >> <h4>Optional TOC <<toc-tiddler>></h4> >> <$macrocall $name="toc-selective-expandable" tag=<<toc- >> tiddler>> > >> </$list> >> </$list> >> >> >> - Nothing will happen right away. >> - Now add the field toc-here to any tiddler and it will provide a toc >> based on the current tiddler. Use new here to add items to its toc >> - If however you give that field a value of tiddlername eg HelloThere >> <https://tiddlywiki.com/#HelloThere> then the tiddlername will be >> used as the root of the TOC >> >> Advantages of this approach >> >> - No additional tag use >> - Ability to reference other parts of a TOC >> >> >> I can see some useful enhancements, but do consider my approach as a >> "Code Pattern" >> >> Regards >> Tony >> >> On Tuesday, January 28, 2020 at 10:36:59 PM UTC+11, Balázs Slemmer wrote: >>> >>> Hi! >>> >>> I would like to show toc-selective-expandable after the contents of >>> every tiddler that is tagged for example 'with-toc'. The root of the table >>> of contents should be the current tiddler. I have tried many approaches >>> (using macros, template tiddlers, etc.), but none of them seems to work. >>> More precisely, they work when the root of the table of contents is a >>> static, hard-coded tiddler title, but stop working when I try to use the >>> title of the current tiddler. Can this be achieved? If so, how? Or is it >>> not possible? >>> >>> Thanks! >>> >> -- 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/589dd0d1-076c-4c99-a7d5-eaa1110c5659%40googlegroups.com.

