[TW5] How to Customize the "New Tiddler" content?

161 views
Skip to first unread message

Douglas Counts

unread,
Feb 8, 2017, 9:16:35 PM2/8/17
to TiddlyWikiDev
I have searched through this group's posts for customize, default, defaults, "New Tiddler", etc.  But I can't find the answer to this question that I expect must have been asked before.

The question is: How do I customize the generated content of the "New Tiddler" that gets generated once you press the "+" button?

I simply want a few empty lines followed by {{PageFooter}} as the last line.

This would provide me with new empty tiddlers possessing a standardized footer for all the new tiddlers. 

Thank you so much in advance.

-Doug

Riz

unread,
Feb 8, 2017, 11:19:34 PM2/8/17
to TiddlyWikiDev
If you want a particular content in all your tiddlers, you are better off with viewtemplate.

Create a tiddler, put your footer in text field.
Add "$:/tags/ViewTemplate" as tag
Create a field called list-after, add the value as "$:/core/ui/ViewTemplate/body"

Now your footer will be added to every tiddler and you can see it when you save the tiddler.

PS: the third step is unnecessary.

Douglas Counts

unread,
Feb 8, 2017, 11:51:32 PM2/8/17
to TiddlyWikiDev
I appreciate your response but I'm looking for a way to place default content inside the "New Tiddler" as I may wish to make changes to it.  Your method, while helpful, puts the same content on all the pre-existing tiddlers too.

I'm looking for a way to define my initial"New Tiddler" content that can then be changed or even deleted.

Any other ideas out there?

Thank you.

BJ

unread,
Feb 9, 2017, 4:16:02 AM2/9/17
to TiddlyWikiDev
Hi Doug,
the relevant documentation is under http://tiddlywiki.com/#WidgetMessage%3A%20tm-new-tiddler

If you want to change the default button the code is in

$:/core/ui/Buttons/new-tiddler

all the best
BJ

Douglas Counts

unread,
Feb 9, 2017, 11:30:12 PM2/9/17
to TiddlyWikiDev
Hi BJ,

I looked at both your most helpful references to the WidgetMessage tm-new-tiddler and the UI Tiddler $:/core/ui/Buttons/new-tiddler and believed that I had this figured out.  I was even able to create a button within a tiddler that did exactly what I wanted using the example within the tm-new-tiddler documentation.

But when I added a text="Text in new tiddler." like shown below to the $:/core/ui/Buttons/new-tiddler, it failed to work.  Any ideas from anyone on what else I need to change to place default text within the generated new tiddlers using the UI New Tiddler button?

<$button message="tm-new-tiddler" tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} text="Text in new tiddler." class=<<tv-config-toolbar-class>>>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTiddler/Caption}}/></span>
</$list>
</$button>

The code within the UI Button is much more confusing than the online example.

Thanks in advance to all replies,

-Doug

BJ

unread,
Feb 10, 2017, 5:20:52 AM2/10/17
to tiddly...@googlegroups.com
Unfortunately the solution is a bit subtle, historically action widgets were invented to overcome the limitations of the widgets like the button widget, and thus the functionality of the button widget is extended like so:

<$button tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-new-tiddler"
  text="Text in new tiddler."/>

<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTiddler/Caption}}/></span>
</$list>
</$button

cheers
BJ

BJ

unread,
Feb 10, 2017, 5:22:05 AM2/10/17
to TiddlyWikiDev
sorry that should be:

<$button tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>
>>
<$action-sendmessage $message="tm-new-tiddler"
  text="Text in new tiddler."/>
<$list filter="[
<tv-config-toolbar-icons>prefix[yes]]">

{{$:/core/images/new-button}}
</$list>
<$list filter="[
<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTiddler/Caption}}/></span>
</$list>
</$button>

Douglas Counts

unread,
Feb 10, 2017, 5:58:52 AM2/10/17
to TiddlyWikiDev
BJ,

Thank you soooooo much.

I was able to get that to work and customized the text to place four empty lines in all new tiddlers with my {{PageFooter}} reference at the bottom of each. Your help gives me a great starting point for all my new tiddlers.

For anyone interesested below is my final solution to editing the New Tiddler button located at $:/core/ui/Buttons/new-tiddler


<$button tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>>>

<$action-sendmessage $message="tm-new-tiddler"
  text="



{{PageFooter}}"/>

<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-button}}
</$list>

<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewTiddler/Caption}}/></span>
</$list>
</$button>


Thanks again,

-Doug

Douglas Counts

unread,
Feb 10, 2017, 6:53:23 AM2/10/17
to TiddlyWikiDev
Wow, that code I posted works.  But because of the extra empty line at line 2, the button caption is placed under the icon when looking at the "Tools" tab, which looks really odd.

It makes the button on the "Tools" tab twice as large as it should be. Removing the empty line fixed where the caption appears on the "Tools" tab icon and the button looks normal there now.

So the corrected code is as follows:
Reply all
Reply to author
Forward
0 new messages