Default Tiddler Configuration

493 views
Skip to first unread message

Jax Kovak

unread,
Apr 29, 2021, 1:12:46 PM4/29/21
to TiddlyWiki
Hello.

Thanks to posts in this group I have been able to create new buttons that are used to create various custom Tiddlers. These are simple and work very well, however I would like to take this one stage further.

The vast majority of my new Tiddlers are created via standard square bracket links in text that are added on the fly and then clicked to create the new Tiddler.

What I want is for those new Tiddlers that are created by clicking on links in text, to be created with some text already in them. I'm not worried about adding tags at this stage.

Is there a system default Tiddler (or some other mechanism) that I can edit or create so that ALL Tiddlers created when clicking on a text link will have my default text in them?

Many thanks for your time

Jax


Jean-Pierre Rivière

unread,
Apr 30, 2021, 5:14:20 AM4/30/21
to TiddlyWiki
I have a kind of a solution for journal tiddler. Journal because you can simply define default text for new journal. For common tiddlers, you'd have to mess with the default template.

first, I define a macro called autotext. For instance:

\define autotext(clever)
<$set name=hail value="Hi! I'n a new tiddler.

!! $clever$
">
<$action-setfield $field=text $value=<<hail>>/>
</$set>
\end

An then I add this as default text for new journal tiddler:

<< autotext "This is great!">>

And when I create a new journal, it appears with the default text above. Just validate it. You see a "do it" button. Just click it. And presto! your text is now set as the hail variable was computed (along your need).

The trick is to be in action mode to be able to change the fields of the tiddler. Which you are not when the initial text is inserted as this experiment do show you (although it could have been the case since in the creation of a new journal, you begin by clicking on a button).

Jax Kovak

unread,
Apr 30, 2021, 11:10:04 AM4/30/21
to tiddl...@googlegroups.com
Thanks Jean-Pierre, but I don't want to change the standard functionality to do this, in fact I'd much rather edit the default template that you mention, but I just don't know the name of it! Now if you can tell me the name of that default template I might well have the answer! 😉 

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/tf-7T3zxEo0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5c301311-9a8d-4ba7-be08-7cabce896fecn%40googlegroups.com.

Jean-Pierre Rivière

unread,
Apr 30, 2021, 11:20:34 AM4/30/21
to TiddlyWiki
Search for NewHere button. An old thread contains a lot of information for a similar quest.

Jax Kovak

unread,
Apr 30, 2021, 11:46:53 AM4/30/21
to tiddl...@googlegroups.com
Thanks again, but I already found this thread and it doesn't help. It creates new Tiddlers from a button which I can already do. I want to be able to change the text in a new Tiddler that is created by clicking a link in text, no buttons required. So if I type [New Tiddler Link]] and click that in the Wiki a new Tiddler with that name is created. That is the kind of Tiddler I want to change. The button created ones don't seem to affect a Tiddler created like this.

Jax Kovak

unread,
May 1, 2021, 7:52:59 AM5/1/21
to TiddlyWiki
Is this really such a difficult thing? I can create new tiddlers with custom text using a button, but I want to be able to do that from [[New Tiddler With Text]] links, which is how most of my new tiddlers get created.

Is there no default blank tiddler that I can edit to have this work?

PMario

unread,
May 1, 2021, 8:26:13 AM5/1/21
to TiddlyWiki
Hi,
It's a bit tricky. ... If you "link" to a non existing tiddler the tiddler body looks like this:

non-existing-tiddler.gif

The "edit button" can be clicked. The text is generated with: https://tiddlywiki.com/#%24%3A%2Flanguage%2FMissingTiddler%2FHint
and contains:

Missing tiddler "<$text text=<<currentTiddler>>/>" -- click {{||$:/core/ui/Buttons/edit}} to create

So you can change it to:

Missing tiddler "<$text text=<<currentTiddler>>/>" -- click {{||$:/core/ui/Buttons/new-here-using-template}} to create

You can use the attachment and the elements that are there.


-mario

NewHere-using-a-template.json

Charlie Veniot

unread,
May 1, 2021, 9:28:23 AM5/1/21
to TiddlyWiki
G'day Jax,

Transclusion and transclusion templates might be your friend here.

Instead of typing into a tiddler links [[like this]], type them in {{ like this || setAsType }}.

Setup setAsType so that if the transcluded tiddler does not exist, the result: place a button to create that tiddler (Tip: Set class to tc-btn-invisible tc-tiddlylink to have a button look like an internal link) with whatever default values, and then open that tiddler.  If the tiddler does exist, then never mind the button and instead show a simple link to the tiddler.

You could then have all sorts of tiddler templates to create tiddlers with default content.  setAsStudent, setAsTeacher, setAsClass, setAsClassRoom ...

If access to backlinks is an issue, then consider Just a neat use of Relinks "References" feature as an alternative way to get backlinks.

Charlie Veniot

unread,
May 1, 2021, 9:37:39 AM5/1/21
to TiddlyWiki
Alternatively, you could add a new button to the tiddler "ViewToolbar" that, when clicked after save of your tiddler, finds all links in the text of the tiddler that are links to tiddlers that do not yet exist, and then creates each one of those tiddlers with default values.  Assuming every single new tiddler you ever create gets the same defaults.

If different tiddlers get different defaults, then you would want the links to have something in the tiddler titles to say what kind of tiddlers they are.

For example:
  • [[John Doe s]] to indicate student
  • [[John Doe t]] to indicate teacher
  • [[Physics 101 c]] to indicate class
  • [[D232 cr]] to indicate class room
So the button goes through each link in the tiddler, determines whether or not the tiddler related to the link exists.  If the link is to a tiddler that does not exist, then get the last part of the tiddler title to determine tiddler "type", and create that tiddler with all of the default values for that type.

Álvaro

unread,
May 1, 2021, 10:01:36 AM5/1/21
to TiddlyWiki
I don't know if I understand you.

When you click in a link you got the tiddler or the empty template of tiddler, that Mario has shown you.

I think that an alternative for it to work with the links, you would have to use the LinkCatcherWidget but I don't have much idea how it works. Maybe it doesn't work.

Charlie Veniot

unread,
May 1, 2021, 10:08:43 AM5/1/21
to TiddlyWiki
I'm guessing it likely is a difficult thing, otherwise it would have been done long ago?

[[some title]] is just a mechanism to show a link that jumps off to the titled tiddler.  It is sweet and simple, and never fails at that purpose: opening a tiddler "window".  That window then just displays without doing actions.  Display existing content of all fields in widgets, but not setting the content of those fields.  Setting content requires an action by a user.  The push of a button.

Not forgetting that the mechanism also handles [[ I prefer show this text | some title ]]

For smarts above and beyond, that's custom behaviour handled by button widgets, action widgets, filters, transclusions, transclusion templates ... all of the stuff for smarts to handle how most of your tiddlers get created, while knowing what to do with the exceptions to the most common tiddlers.

Aside: the transclusion template approach in my previous post.  Way less wordy, once you get used to abbreviations, to use things like {{John Doe||tS}} instead of the brutally wordy (but more descriptive for discussion) {{ John Doe || setAsStudent }}



Charlie Veniot

unread,
May 1, 2021, 10:14:10 AM5/1/21
to TiddlyWiki
Oh no, I'm just talking about pressing a button in the ViewToolbar after saving a tiddler.

So post-save button that says to TiddlyWiki: okay, please go ahead and create my missing tiddlers now, as per the defaults I like.

For example, a new button like the one in Alternative tiddler editor: text à la JSON, but that does what you want need to the current tiddler, not the mess of stuff my button does.

Charlie Veniot

unread,
May 1, 2021, 10:23:13 AM5/1/21
to TiddlyWiki
BTW, apologies, I posted before seeing PMario's post.  I'm going into slightly different directions, although we both seem to be leaning towards: you need a button.

On Saturday, May 1, 2021 at 11:01:36 AM UTC-3 Álvaro wrote:

Charlie Veniot

unread,
May 1, 2021, 1:32:24 PM5/1/21
to TiddlyWiki
Hello again,

If I were setting up to do what I think you're looking for, I would use Code Pattern: Missing Tiddlers Manager as my starting point, likely placing the manager in the sidebar.

If had had a variety of default content for different kinds of tiddlers, I think I'd have a series of buttons for each missing tiddler, one "create this  tiddler with these defaults" button for each type of tiddler I'd want to create, for every missing tiddler.

Something like that.

Jax Kovak

unread,
May 2, 2021, 8:04:33 AM5/2/21
to tiddl...@googlegroups.com
So, it's looking very much like the buttons are the only way to go with this. Shame, but I already have a couple of custom buttons so its not exactly a hardship, Id just rather be able to type as normal, save that Tiddler and then immediately click on a link to a non-existent tiddler and carry on. Oh well.

Thanks to everyone for your suggestions. I have buttons already so Ill have to keep going with them for now.

Regards

JK

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/tf-7T3zxEo0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Charlie Veniot

unread,
May 2, 2021, 1:37:13 PM5/2/21
to TiddlyWiki
Yeah, but that sample I created is one button that will batch-create an unlimited number of missing tiddlers.  You just need to modify it so that it creates all tiddlers with your preferrred default values.  That's a fair bit of good bang for the buck.

More suitable for your purposes:

I'd suggest that you create an alternative tiddler save button that saves the tiddler and then immediately does the batch-creation of missing tiddlers in the same was as my "Missing Tiddlers Manager" does.  I suggest that instead of altering the current save mechanism just to future-proof your custom save.

PMario

unread,
May 2, 2021, 5:26:08 PM5/2/21
to TiddlyWiki
On Sunday, May 2, 2021 at 2:04:33 PM UTC+2 isd196...@gmail.com wrote:
So, it's looking very much like the buttons are the only way to go with this. Shame, but I already have a couple of custom buttons so its not exactly a hardship, Id just rather be able to type as normal, save that Tiddler and then immediately click on a link to a non-existent tiddler and carry on. Oh well.

Did you see my suggestion? You can click on the link of a missing tiddler, which opens it ... 1st click.
You click the "edit button" ... 2nd click ... done

What's wrong with that? I'm sure that 1 more click will not cost you more than half a second in your workflow. ...

-mario

Charlie Veniot

unread,
May 2, 2021, 6:17:09 PM5/2/21
to TiddlyWiki
I'm sure Jax saw your suggestion, but I can feel his pain.

Myself, I am very passionate about reducing mouse-clicky-induced-tendinitis o' the finger knuckle.  We are going to have generations of people who just can't poke their significant others in the forehead when these significant others deserve a finger-poke in the forehead.

But seriously, distraction-free clickless rock'n rolling when the words and thoughts are flowing like a torential river, that's a pretty wonderful thing.

A bit like CamelCase.  I'm no fan, but when one just wants to quickly write, avoiding them brackets is a good thing.

So I can appreciate wanting to squeeze out every drop of efficiency.

Probably a little odd coming from me, because mindless clicking/distractions give me time to process the thoughts into a little bit of coherence.  Yeah, I'm a little bit granola, liking the time to smell the flowers.

Jax Kovak

unread,
May 3, 2021, 11:30:42 AM5/3/21
to TiddlyWiki
PMario my apologies! I did not see your post!

However, I have downloaded and imported "NewHere-using-a-template.json" but I cant seem to get it to work. The import went okay and I restarted the Wiki but I still have the default empty Tiddler when I click a link that does not exist yet. Am I missing something?

Regards

JK

Jax Kovak

unread,
May 3, 2021, 1:21:53 PM5/3/21
to TiddlyWiki
An Update:

For some reason the New here button does not show up, this is what was throwing me off. However, having edited the code from:
<tv-config-toolbar-icons>match[yes]] to <tv-config-toolbar-icons>prefix[yes]]
and
<tv-config-toolbar-text>match[yes]] to <tv-config-toolbar-text>prefix[yes]]
I managed to get the button to show up (No, I have no idea why this worked but this is what I have on my own custom buttons), however, this still only opened the new Tiddler with the correct name but empty body text, regardless of editing the NewTiddler Template.

So that is where I have reached. I can get the button, I can get the new Tiddler to accept the name that was clicked (The Empty Tiddler link), but I cant get any content into that new Tiddler!

Any guidance would be much appreciated.

Regards

JK

PMario

unread,
May 3, 2021, 10:34:01 PM5/3/21
to TiddlyWiki

Jax Kovak

unread,
May 4, 2021, 7:33:36 AM5/4/21
to TiddlyWiki
Ah! I forgot to mention that I have already edited the language/MissingTiddler/Hint as well.

When I click a missing tiddler link I get as far as seeing the new tiddler, with the correct name and it contains the contents of the MissingTiddler/Hint, but when opened with the normal edit button or the NewHere button added by the imported script, the tiddler remains empty when opened, which suggests that when it gets opened something is removing the contents..

I cant see that it would matter much but I am using TiddlyDesktop. 

It is most frustrating.

Regards

JK

PMario

unread,
May 4, 2021, 8:56:38 AM5/4/21
to TiddlyWiki
Hi,
Have a look at the image from my first post. There is a marker, that says "click". ...

It should be possible to create a "New Edit with Template" button. ... But I didn't do that. I did recycle the code from this thread: https://groups.google.com/g/tiddlywiki/c/sQr3OJwnj8I/m/Qnv_Z9KsAgAJ

-m

Jax Kovak

unread,
May 4, 2021, 11:27:22 AM5/4/21
to TiddlyWiki
Yes, Iv tried clicking that small image indicated in the image, and the button and the default button. No joy I'm afraid.
Reply all
Reply to author
Forward
0 new messages