I use Markdown exclusively. I’ve added a “new Markdown tiddler”[^1] button to the sidebar, no problem there. But how do I change the “click edit to create” button to make a Markdown tiddler? (Currently it is making a new tiddler with an empty content type.) (TW 5.1.23)
[^1]: When you use a wikilink in a tiddler that hasn’t been created yet, and then you click on it, and you get a “missing tiddler” tiddler - and it has a button which is the “click edit to create” button.
I don’t see a “Page” button. There was a “new tiddler” button which I unchecked because I added a “new Markdown tiddler” button which is all I use.
I’m talking about when you’re not using the sidebar, but instead you’re just writing/editing a tiddler when you type in a new tiddler name that doesn’t exist yet. Then you click on that name and get a empty new tiddler ready to go (except it has the correct name already). Instead of any actual content it has this “click edit to create” button. That’s what I want to change the behavior of.
It has this behavior because that is the behavior of Edit button. So you need create a new button which also set the field Type to a markdown and then you change it in $:/language/MissingTiddler/Hint
The edit button works by sending tm-edit-tiddler. But that message is defined to replace the current tiddler and it takes only a title as parameter. Unlike tm-new-tiddler which can also take additional fields, like type.
So I don’t know how to send the type over. I’m already way beyond my understanding - and I have to say, tiddlywiki.com is definitely not helpful. (See below.) So I’d still appreciate some actual code in addition to saying “do this, do that”. I know people try to be helpful with other TW beginners - but you have to make an allowance, I hope, for real lack of knowledge and no way to get it (see below). (I’ve already spent a couple of hours on this.)
First thing it says is “start by cloning the New Journal button” which is harder than you think because “clone” is hidden on the dropdown in the “more” dropdown on the tiddler button bar, and a search in tiddlywiki.com for “clone” turns up nothing relevant at all. But if you finally remember to look at “more” and find the clone command then it tells you to do a search/replace on certain code you’ll see there in your clone. Except: Apparently it is talking about some older version of TW because the code you’re looking at doesn’t look anything like what it is suggesting.
The tiddler “Messages” is simply a list of messages - no indication of how to use them. And same for all of the individual message tiddlers, e.g., “tm-edit-tiddler” has no example.
And since “tm-edit-tiddler” claims to replace the tiddler you’re pressing the button in (this is the missing tiddler scenario) how exactly is it going to work to set the field in it unless you can send a message - which doesn’t seem to exist (there’s no “set field”, only an “add field”.)
Etc. etc. Raised far more questions than answers, I’m sorry to say.
So, in conclusion, I’d really appreciate your help. This must be simple - yet, impossible to discover how.
Thank you Mark, but I’ve done that! I have a “new markdown tiddler” button for a toolbar - it comes with the markdown plugin. But you’re sending the message “tm-new-tiddler”, which, if you use it from a “missing tiddler” - that is you clicked on a missing tiddler’s link, you get a tiddler which says “click EDIT to create this tiddler” ← where EDIT is a button - then that button uses “tm-edit-tiddler” which replaces the missing tiddler where if you use “tm-new-tiddler” there it opens up a new tiddler to edit, then you’ve got the “missing” one still there …
And (according to the documentation) “tm-edit-tiddler” doesn’t take a “type” parameter (or a bag-of-fields parameter) …
David, It can be a common problem on the tiddlyiki forums that we have so many different experience levels. Then some advanced users do not know anything about a specific method. For regular responders such as myself, mark, mario and Eric it is easier for us to respond to people at a mid level of understanding and later adjust as the users level becomes more apparent. Feel free to ask questions which indicate your limited knowledge, we all have to start some where.
My time is somewhat limited but let me make these points
The actioncreatetiddler widget is the more comprehensive way to make tiddlers
Using the messages such as tm-edit-tiddler are simplified, look further for more appropriate actions.
If a tiddler already exists changing particular fields uses the various field actions.
You can use this to set the Type field if not included in the actionCreate Tiddler.
or in actioncreate tiddler type=“text/x-markdown”
Following a link to a missing tidder, although you see it, it is not created until you edit it, or click the button to create it.
When creating a tiddler you may still need to navigate to it to see it (see action navigate)
TW - ok, now that’s actually good help, thank you! I’ll look at the action create tiddler - I didn’t know that “messages” are simplified actions - in fact, “messages” aren’t describe in tiddlywiki.com!
I also look straight in the repo for code too (though I don’t build TW myself).
I don’t know what you’re saying or what you want. I thought you were concerned about the situation where if you click on a missing tiddler link, you can’t then make a new markdown tiddler with the same name as the missing link. The code I provided will do that. An additional button appears which allows you to create the missing tiddler as a markdown. The tiddler is created open for editing, which is usually the first thing you want to do.
If you didn’t try the code, you might have assumed it was no different than your existing code. When the new tiddler is created with the markdown button I provided, the existing (non-existent) tiddler is over-written and is open for editing. So you don’t need tm-edit-tiddler.
In tiddler $:/language/MissingTiddler/Hint in text field in {{||$:/core/ui/Buttons/edit}} you have to change $:/core/ui/Buttons/edit for the title of your tiddler