How to create a new tiddler with custom predefined fields?

1,657 views
Skip to first unread message

Alexei R

unread,
Jul 30, 2018, 2:20:21 AM7/30/18
to TiddlyWiki
Hello all

Please help me to find the best way to create a new tiddlers with custom predefined fields. 
Preferably I need to be able to create a couple different types of tiddlers each with different set of fields...

--
Alexei

FrD

unread,
Jul 30, 2018, 3:57:23 AM7/30/18
to TiddlyWiki
Hi,

You can add any field or tag you want to the tiddler you are creating.
See in Contents and Attributes  :

{any attributes not starting with $}Each attribute name specifies a field to be created in the new tiddler

Regards

FrD

Alexei R

unread,
Jul 30, 2018, 7:04:28 AM7/30/18
to TiddlyWiki
Thank you.

Well........
It seems to me extremely complicated to do. And can't get my head around it :-(
Can you give me some example please?

FrD

unread,
Jul 30, 2018, 7:52:57 AM7/30/18
to TiddlyWiki
Hi,

In order to use action widgets you need to use a button widget or a select widget or any widget that can trigger actions.
You don't have to use actionsetfield as you can specify the fields to be created within the actioncreatetiddler widget.

But maybe if you want the fields already populated, you'd better create a template tiddler and use the tm-new-tiddler message : https://tiddlywiki.com/#WidgetMessage%3A%20tm-new-tiddler


Regards

FrD

Alexei R

unread,
Jul 30, 2018, 8:22:16 AM7/30/18
to TiddlyWiki
Please give me some simple example.

Ton Gerner

unread,
Jul 30, 2018, 8:28:07 AM7/30/18
to TiddlyWiki

Alexei R

unread,
Jul 30, 2018, 9:03:13 AM7/30/18
to tiddl...@googlegroups.com
Let's say I need to prepare catalog of my computers.
And I need to create multiple tiddlers that contains the following text:
;Computer Name
:{{!!Computer_Name}}
;Computer_Model
:{{!!Computer_Model}}
;Computer Manufacturer
:{{!!Computer_Manufacturer}}

And when which of them has following predefined fields:
  • Computer_Name
  • Computer_Model
  • Computer_Manufacturer
I expect to give different values to thees fields at different tiddlers and to receive nicely rendered results.
How can I do it?

FrD

unread,
Jul 30, 2018, 9:18:55 AM7/30/18
to TiddlyWiki
Hi,

Create a tiddler as in the picture below (this will be the "template"). I called it Computer_Template
In another tiddler enter this code :
<$button message="tm-new-tiddler" param="Computer_Template">Create New Computer Tiddler</$button>

Clicking on the button will create a new tiddler like the template tiddler.

Regards

FrD
2018-07-30 15_14_40.jpg

Alexei R

unread,
Jul 30, 2018, 10:42:07 AM7/30/18
to TiddlyWiki
Tank you very match! 
You'v just made my day :-)

Alexei R

unread,
Jul 30, 2018, 10:43:32 AM7/30/18
to TiddlyWiki
Is there way to add this button to any toolbar?


On Monday, July 30, 2018 at 4:18:55 PM UTC+3, FrD wrote:

FrD

unread,
Jul 30, 2018, 11:26:14 AM7/30/18
to TiddlyWiki
Hi,

Try to tag your button tiddler with $:/tags/PageControls, or $:/tags/EditToolbar or $:/tags/ViewToolbar.

Regards

FrD

Alexei R

unread,
Aug 3, 2018, 7:02:04 PM8/3/18
to tiddl...@googlegroups.com
I'v just discovered the Stephan's Hradek impressive work TW5 Magick at http://tw5magick.tiddlyspot.com/
At 2014 he put together a "simple Contacts DB" that supposed to do exactly what I'm looking for.
But it bit outdated and didn't work well in current TiddlyWiki.
Can someone help to update it and get it working well?

On Monday, July 30, 2018 at 9:20:21 AM UTC+3, Alexei R wrote:

passingby

unread,
Aug 3, 2018, 9:52:37 PM8/3/18
to TiddlyWiki


On Monday, July 30, 2018 at 6:22:16 AM UTC-6, Alexei R wrote:
Please give me some simple example.


I have this tiddler in my TW which creates a simple contact tiddler.

<$button class='tc-btn-invisible' tooltip="Create a new contact">
<$action-createtiddler
$basetitle='New Contact'
tags='contact'
firstname=''
middlename=''
lastname=''
address=''
phone=''
email=''
reference=''
birth=''
death=''
$savetitle='$:/.user/CreateContact!!newContact'
/>
<$action-sendmessage
$message="tm-edit-tiddler"
$param={{$:/.user/CreateContact!!newContact}}/>
{{$:/.user/images/add-contact.svg}}
</$button>
 

So a button is created, which when pressed not only creates the tiddler with pre-defined fields but also opens it up for editing. Just like New Tiddler button. 

TonyM

unread,
Aug 4, 2018, 4:56:26 AM8/4/18
to TiddlyWiki
Alexie

See the other thread https://groups.google.com/forum/m/?hl=en#!topic/tiddlywiki/swbra9EhOm4

I will post in a day or two my "new tiddler from template tiddler" tool which is another way to achive the same result.

Regards
Tony

Alexei R

unread,
Aug 4, 2018, 5:22:42 AM8/4/18
to TiddlyWiki
I simplified it a bit. And removed : class='tc-btn-invisible' and {{$:/.user/images/add-contact.svg}} from $button, $savetitle='$:/.user/CreateContact!!newContact' from $action-createtiddler and $param={{$:/.user/CreateContact!!newContact}} from $action-sendmessage
<$button tooltip="Create a new contact">Create a new contact


<$action-createtiddler $basetitle='New Contact'
tags='contact'
firstname=''
lastname=''
phone=''
email=''
/>

<$action-sendmessage $message="tm-edit-tiddler" />

</$button>


Reply all
Reply to author
Forward
0 new messages