How to add field to default new tiddler?

1,091 views
Skip to first unread message

Mark S.

unread,
Jun 6, 2015, 1:15:49 PM6/6/15
to tiddl...@googlegroups.com
If I wanted every new tiddler to have certain fields automatically, how would I do that?

Thanks,
Mark

Danielo Rodríguez

unread,
Jun 6, 2015, 3:20:16 PM6/6/15
to tiddl...@googlegroups.com
Your best choice is to use a custom button with a custom template.

Mark S.

unread,
Jun 6, 2015, 3:29:32 PM6/6/15
to tiddl...@googlegroups.com
So it's not configurable?

Thanks,
Mark

PMario

unread,
Jun 6, 2015, 3:48:57 PM6/6/15
to tiddl...@googlegroups.com

Mark S.

unread,
Jun 6, 2015, 4:53:54 PM6/6/15
to tiddl...@googlegroups.com
Thanks, but I'm trying to avoid rolling my own buttons. What I want is for the default new tiddler to have an additional field or two automatically added.

I thought there would be something like EditTemplate that could be edited (like in TWC, I think), but can't find the equivalent in TW5.

Thanks,
Mark

Eric Shulman

unread,
Jun 6, 2015, 5:03:19 PM6/6/15
to tiddl...@googlegroups.com
On Saturday, June 6, 2015 at 1:53:54 PM UTC-7, Mark S. wrote:
I thought there would be something like EditTemplate that could be edited (like in TWC, I think), but can't find the equivalent in TW5.

In TWC, configuration is done by editing specially-named tiddlers (e.g. EditTemplate, ViewTemplate, Stylesheet, etc.)

In TW5, configuration is done by tagging a tiddler with a specially-named tag.  Thus, to add something to the tiddler editor, you simply create a tiddler with the additional editing controls, and then tag that tiddler with "$:/tags/EditTemplate".

-e

Mark S.

unread,
Jun 6, 2015, 6:54:13 PM6/6/15
to tiddl...@googlegroups.com
Thanks Eric,

So is there a special tag to add new variables?  As best I understand it, new variables for a *particular* tiddler go into some type of list. So I assume there must be some way to insert field names into that list??

I'm surprised this hasn't come up before. If you want a TW to track your bookmarks, then you know every tiddler is going to need a url. If you want a Photo Gallery TW, then every tiddler is going to need an image path and a thumbnail path.

Thanks!
Mark

Jeremy Ruston

unread,
Jun 7, 2015, 4:47:28 AM6/7/15
to TiddlyWiki
Hi Mark

So is there a special tag to add new variables?  As best I understand it, new variables for a *particular* tiddler go into some type of list. So I assume there must be some way to insert field names into that list??

I think you mean "fields" not "variables"?
 
I'm surprised this hasn't come up before. If you want a TW to track your bookmarks, then you know every tiddler is going to need a url. If you want a Photo Gallery TW, then every tiddler is going to need an image path and a thumbnail path.

If I'm understanding your needs correctly, you need to add custom segments to the edit template that include edit controls for the fields you're interested in.

Best wishes

Jeremy.

 

Thanks!
Mark

On Saturday, June 6, 2015 at 2:03:19 PM UTC-7, Eric Shulman wrote:
On Saturday, June 6, 2015 at 1:53:54 PM UTC-7, Mark S. wrote:
I thought there would be something like EditTemplate that could be edited (like in TWC, I think), but can't find the equivalent in TW5.

In TWC, configuration is done by editing specially-named tiddlers (e.g. EditTemplate, ViewTemplate, Stylesheet, etc.)

In TW5, configuration is done by tagging a tiddler with a specially-named tag.  Thus, to add something to the tiddler editor, you simply create a tiddler with the additional editing controls, and then tag that tiddler with "$:/tags/EditTemplate".

-e

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a7db3b8e-f0c3-42ca-a1f5-f94a29a828a1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



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

Danielo Rodríguez

unread,
Jun 7, 2015, 7:10:04 AM6/7/15
to tiddl...@googlegroups.com
Hello,

I think I understand what you want, and what Eric have pointed it's what you need. TW5 is easier to configure than TWC if you know the proper tags to do it. So, for what you want, create a tiddler named $:/MyCustomField (or whatever you want, but add $:/ fitst to avoid it polluting your wiki) and put the following text inside it:

<$edit-text field="yourfield" default="" placeholder="add text here" tag="input"/>

Then tag that tiddler $:/tags/EditTemplate and you're done!

Mark S.

unread,
Jun 7, 2015, 2:03:09 PM6/7/15
to tiddl...@googlegroups.com
Thanks Danielo,

This sort of works. An unlabeled field shows up on the bottom. If you type into it, a labeled field appears above with the field and contents. In other words, the field you want doesn't show up as a field until you've type into  The "default" attribute is ignored.

The hope was to avoid having the user remember to create the field every time.

I'm not sure how this is easier than simply modifying one template and ... ta-dah! ... you're done.

I guess the solution for TW5 is to roll your own new tiddler button, and then take away all the other "new tiddler" options.

Thanks!
Mark
Mark

Mark S.

unread,
Jun 7, 2015, 2:03:53 PM6/7/15
to tiddl...@googlegroups.com, jeremy...@gmail.com


On Sunday, June 7, 2015 at 1:47:28 AM UTC-7, Jeremy Ruston wrote:
Hi Mark

So is there a special tag to add new variables?  As best I understand it, new variables for a *particular* tiddler go into some type of list. So I assume there must be some way to insert field names into that list??

I think you mean "fields" not "variables"?

Yes

Thanks,
Mark

Eric Shulman

unread,
Jun 7, 2015, 2:49:28 PM6/7/15
to tiddl...@googlegroups.com
On Sunday, June 7, 2015 at 11:03:09 AM UTC-7, Mark S. wrote:
The hope was to avoid having the user remember to create the field every time.
I'm not sure how this is easier than simply modifying one template and ... ta-dah! ... you're done.
I guess the solution for TW5 is to roll your own new tiddler button, and then take away all the other "new tiddler" options.

If you want *all* tiddler's to have the same extra field(s), then using a "template tiddler" is the right way.

However, you don't have to "take away all the other new tiddler options"... just edit
   $:/core/ui/Buttons/new-tiddler
and add
   param="NameOfTemplateTiddler"
like this:
   <$button message="tm-new-tiddler" param="NameOfTemplateTiddler" tooltip=...

From then on, *all* instances of the core new tiddler button will use the template when creating new tiddlers.  Q.E.D.

Note: modifying shadow tiddlers is discouraged because it will block automatic core upgrades to the modified shadows.  However, in this particular use case, it is the right thing to do.  Just be aware of this when/if you upgrade your document.

-e



Reply all
Reply to author
Forward
0 new messages