TW5 Default type

809 views
Skip to first unread message

Tomáš Greif

unread,
Apr 8, 2014, 3:45:31 AM4/8/14
to tiddl...@googlegroups.com
Hi,

how do I set default type in TW5? I am using markdown for all tiddlers and would like this to be set by default.

Regards,

Tomas

Jeremy Ruston

unread,
Apr 8, 2014, 3:54:59 AM4/8/14
to TiddlyWiki
Hi Tomáš

how do I set default type in TW5? I am using markdown for all tiddlers and would like this to be set by default.

Instead of using the new tiddler button to create new tiddlers, you can use a button that clones a skeleton tiddler that has been set up with the required default type (and tags etc).

1. Add a new tiddler with the tag $:/tags/PageControls and the content:

<$button message="tw-new-tiddler" param="mySkeleton">new</$button>

2. Create a new tiddler "mySkeleton" with the type "text/x-markdown"

3. If you want to remove the existing "new tiddler" button you can just create a blank tiddler with the title "$:/core/ui/PageControls/new-tiddler"

Best wishes

Jeremy




--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Tomáš Greif

unread,
Apr 8, 2014, 4:18:17 AM4/8/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy,

thank you for your answer. This works perfectly, but I do not know how to display this button somewhere so I see it always. 

(and a note: If there is someone as new as I am, than you should put $:/tags/PageControls in name of tiddler, not as a tag as I tried)

Tomas

Dne úterý, 8. dubna 2014 9:54:59 UTC+2 Jeremy Ruston napsal(a):

Jeremy Ruston

unread,
Apr 8, 2014, 4:23:42 AM4/8/14
to Tomáš Greif, TiddlyWiki
Hi Tomáš

> thank you for your answer. This works perfectly, but I do not know how to display this button somewhere so I see it always. 

Adding the tag $:/tags/PageControls should cause the button to appear in the sidebar, next to the existing three buttons.

(and a note: If there is someone as new as I am, than you should put $:/tags/PageControls in name of tiddler, not as a tag as I tried)

No, you should add $:/tags/PageControls as a tag. It doesn't matter what you call the tiddler containing the button widget.

Best wishes

Jeremy


Tomáš Greif

unread,
Apr 8, 2014, 4:25:59 AM4/8/14
to jeremy...@gmail.com, TiddlyWiki
Aaaah, now it works.

Thank you!

Regards,

Tomas

Gerald Strickland

unread,
Sep 22, 2014, 2:07:00 PM9/22/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy,

After upgrading from 5.0.13-beta to 5.1.1 today - my markdown button doesn't work anymore. I checked and verified that I still have the following:

1. Add a new tiddler with the tag $:/tags/PageControls and the content:

<$button message="tw-new-tiddler" param="mySkeleton">new</$button>

2. Create a new tiddler "mySkeleton" with the type "text/x-markdown"

Both tiddlers are still there, the button is there.... but clicking on the button doesn't open anything... your thoughts/suggestions?

Thanks!

Eric Shulman

unread,
Sep 22, 2014, 2:18:54 PM9/22/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
As of 5.0.16, Jeremy changed the prefixing on standard TW messages, classes, and variables.  Instead of a general "tw-" prefix, they now use "tm-", "tc-", and "tv-" respectively.  Thus, in your button, you need to write:
<$button message="tm-new-tiddler" param="mySkeleton">new</$button>

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
Message has been deleted

Gerald Strickland

unread,
Sep 22, 2014, 2:33:26 PM9/22/14
to tiddl...@googlegroups.com
Thanks for the info Eric! It worked.

Daniel

unread,
Jan 15, 2016, 4:30:37 AM1/15/16
to TiddlyWiki
Also thanks from my side - this works nicely.

I made that button use the Markdown logo from https://de.wikipedia.org/wiki/Markdown#/media/File:Markdown-mark.svg using this content for the button tiddler:

<$button class="tc-btn-invisible" title="Create new Markdown Tiddler" message="tm-new-tiddler" param="markdownSkeleton">
<svg class="tc-image-home-button tc-image-button" viewBox="0 0 208 128">
       
<!-- logo is licensed CC0, downloaded from https://de.wikipedia.org/wiki/Markdown#/media/File:Markdown-mark.svg | changed colour | by @nordholmen -->
   
<rect style="fill:none;stroke:#aaa;stroke-width:10" width="198" height="118" x="5" y="5" ry="10" />
   
<path style="fill:#aaa" d="m 30,98 0,-68 20,0 20,25 20,-25 20,0 0,68 -20,0 0,-39 -20,25 -20,-25 0,39 z" />
   
<path style="fill:#aaa" d="m 155,98 -30,-33 20,0 0,-35 20,0 0,35 20,0 z" />
</svg>
</$button>



Just in case anyone finds this useful.

Best regards,
Daniel

Tobias Beer

unread,
Jan 15, 2016, 4:53:09 AM1/15/16
to TiddlyWiki
Hi Daniel,

I think using the action-sendmessage widget makes this process easier:

<$button class="tc-btn-invisible" title="Create new Markdown Tiddler">
<$action-sendmessage $message="tm-new-tiddler" type="text/x-markdown"/>
<svg class="tc-image-home-button tc-image-button" viewBox="0 0 208 128">
       
<!-- logo is licensed CC0, downloaded from https://de.wikipedia.org/wiki/Markdown#/media/File:Markdown-mark.svg | changed colour | by @nordholmen -->
   
<rect style="fill:none;stroke:#aaa;stroke-width:10" width="198" height="118" x="5" y="5" ry="10" />
   
<path style="fill:#aaa" d="m 30,98 0,-68 20,0 20,25 20,-25 20,0 0,68 -20,0 0,-39 -20,25 -20,-25 0,39 z" />
   
<path style="fill:#aaa" d="m 155,98 -30,-33 20,0 0,-35 20,0 0,35 20,0 z" />
</svg>
</$button>

Best wishes,

Tobias.

Davïd

unread,
Jun 13, 2016, 4:13:31 AM6/13/16
to TiddlyWiki
I'm happily using Tobias Beer's solution, with one small change: the first line I have this way:

<$button tooltip="Create new Markdown tiddler" class="tc-btn-invisible">

It seems the "title" field is filtered out, but the "tooltip" field works. I'm not sure why this should be so, but it is. I'm using 5.1.11 at the moment.

It would be great to get the hover states of the default Page Controls, but that would be "icing"! I'm quite satisfied with the "cake" of being able to create a Markdown tiddler with a click. :)

David.

Jeremy Ruston

unread,
Jun 13, 2016, 9:55:14 AM6/13/16
to tiddl...@googlegroups.com
By the way, the upcoming 5.1.12 release includes an updated Markdown plugin that includes a “New Markdown tiddler” button. You can see it here:


Best wishes

Jeremy

-- 
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.

Mat

unread,
Jun 13, 2016, 10:39:54 AM6/13/16
to TiddlyWiki


On Monday, June 13, 2016 at 10:13:31 AM UTC+2, Davïd wrote:
I'm happily using Tobias Beer's solution, with one small change: the first line I have this way:

<$button tooltip="Create new Markdown tiddler" class="tc-btn-invisible">

It seems the "title" field is filtered out, but the "tooltip" field works. I'm not sure why

If you look at the docs for buttonwidget you'll see there is no "title" parameter. The way to get a button label to show is to simply put it between the markup tags 

<$button ... >like this</button> 

<:-)

Davïd

unread,
Jun 13, 2016, 5:01:13 PM6/13/16
to TiddlyWiki
Great news! Thanks for the "heads-up".

Davïd

unread,
Jun 13, 2016, 5:02:23 PM6/13/16
to TiddlyWiki
Pointer to the docs appreciated. I'm a regular, but not very intensive, TW user, so this is a real help. Thanks!
Reply all
Reply to author
Forward
0 new messages