[TW5] Creating a ViewTemplate to show some text above the content

145 views
Skip to first unread message

Alexander Eckert

unread,
May 27, 2016, 7:48:09 PM5/27/16
to TiddlyWiki
Hi,

I'm new to TW and I try to create my own knowledgebase. Therefore I'm building my own Plugins to use their function in different wikis.

ATM I'm trying to create a ViewTemplate to show some text (in this case the author of a book) above the edited content of the tiddler. But every content in the text-field is shown above my VieTemplate code.

I tried <transclude /> and {{!!text}} to show the text-content below, but everytime I use this I get the content shown twice. Above and below the name and link of the author.

How could I suppress the content at the beginning inside the ViewTemplate and insert the text at the place I want the content to appear?

Kind regards,

Alex

Jed Carty

unread,
May 28, 2016, 3:35:05 AM5/28/16
to TiddlyWiki
To do this you set where in the main view template you want your template to appear. The normal tiddler view template is made up of a few separate parts that are displayed using a list widget.
So to change the position or your viewtemplate in the order you can create a field called 'list-after' and put the part you want your template listed after in that field. The options are:

$:/core/ui/ViewTemplate/body
$:/core/ui/ViewTemplate/subtitle
$:/core/ui/ViewTemplate/tags
$:/core/ui/ViewTemplate/title

You will probably want to use $:/core/ui/ViewTemplate/tags.

Alexander Eckert

unread,
May 28, 2016, 10:30:06 AM5/28/16
to TiddlyWiki
Thank you very much. This worked for me. I split up my ViewTemplate in "before" and "after" and it worked =)

Nice, thanks.
Reply all
Reply to author
Forward
0 new messages