[TW5] How open a tid in edit mode?

157 views
Skip to first unread message

Mat

unread,
Mar 23, 2015, 8:00:13 PM3/23/15
to tiddl...@googlegroups.com
I messed up and happened to show an image much too big. So big it covers the toolbar completely... actually the whole tiddler... actually the whole frickin' bottom half of the TW, from side to side!

I can still reach the full sidebar, so I can close it (via tab Open).

But how can I edit this?

To my frustration, it does not seem possible to enter "draft of" in the url (after making sure it is the correct url), and reload - it is treated as if a separate tiddler (which is not existing).

I guess it's possible to dig around in the source code but hope there is some much easier way.

Thank you!

<:-)

Jed Carty

unread,
Mar 23, 2015, 8:08:15 PM3/23/15
to tiddl...@googlegroups.com
Create a new tiddler and put

<$edit-text tiddler=TiddlerName/>

Where you replace TiddlerName with the name of the tiddler you want to edit.
You should be able to edit the text of the broken tiddler in the new tiddler that way.

Eric Shulman

unread,
Mar 23, 2015, 9:56:07 PM3/23/15
to tiddl...@googlegroups.com
It easy to create a button that opens edit mode for any specified tiddler by writing:
{{SomeTiddler||$:/core/ui/Buttons/edit}}

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

"Inside TiddlyWiki: The Missing Manual"
Note: the IndieGogo funding campaign has ended,
but direct fundraising continues below...

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:
 

Mat

unread,
Mar 24, 2015, 3:25:02 AM3/24/15
to tiddl...@googlegroups.com
Thank you guys, you saved me!!!

For the record, for those that don't know:

Jeds variant should be with quotes around the TiddlerName if including spaces:
<$edit-text tiddler="Tiddler Name"/>

...and, for both Erics and Jeds;
because TW treats a tiddle and its draft as different, um, "entities"(?) then the name of a draft includes all characters in:
Draft of 'Tiddler Name' (btw, exactly as it reads in tab Open)

<:-)


Mat

unread,
Mar 24, 2015, 4:20:08 AM3/24/15
to tiddl...@googlegroups.com
Some related questions:

a) The editor field resulting from Jeds solution is only some 4 cm wide. Where (and why) is that set?

b) The documentation on the EditTextWidget, states that

size - The size of the input field (in characters)

- what does "in characters" mean? Assuming the following is correct syntax, what should I write inside size="..." ?

<$edit-text tiddler="SomeTiddler" size="..."/>


c) The doc also states "
The content of the <$edit-text> widget is ignored."

...what does that mean? It is not evaluated/parsed?


Thanks!

<:-)

Eric Shulman

unread,
Mar 24, 2015, 6:39:33 AM3/24/15
to tiddl...@googlegroups.com
On Tuesday, March 24, 2015 at 1:20:08 AM UTC-7, Mat wrote:
Some related questions:
a) The editor field resulting from Jeds solution is only some 4 cm wide. Where (and why) is that set?
b) The documentation on the EditTextWidget, states that
size - The size of the input field (in characters)
- what does "in characters" mean? Assuming the following is correct syntax, what should I write inside size="..." ?

The "size" attribute is passed along to the HTML <input> tag produced by the widget.  This attribute changes the horizontal size of the input field, using some internal browser calculation to determine how many pixels are needed to show the indicated number of characters in the current font.  Unfortunately, this is typically a very inaccurate calculation and the input field will generally be somewhat wider than the actual size needed to fit the specified character length.  You'd be better off defining a CSS class, like this:

.myEdit input { width:100%; }

and then writing

@@.myEdit <$edit-text .../>@@

c) The doc also states "The content of the <$edit-text> widget is ignored."
...what does that mean? It is not evaluated/parsed?

Just like HTML syntax, TW widgets have both <$widgetname> and </$widgetname> markers that can surround content.  What the widget does with that content depends entirely on the specfic widget in question.  For example, in the <$list> widget, you typically write something like:
<$list filter="...">
  some content here
</$list>
where the content in between <$list> and </$list> is used to render each item matched by the filter.

However, in the case of the <$edit-text> widget, it doesn't have any use for content that might be provided in between the <$edit-text> and </$edit-text> markers. This is why the documentation says, "the content .. is ignored".

Note also that, because <$edit-text> doesn't need any enclosed content, there's actually no need for the matching </$edit-text> marker and instead, a trailing / is placed in the opening widget marker, like this:
 <$edit-text ... params... />
and the corresponding </$edit-text> marker is simply omitted.

Andrew

unread,
Mar 24, 2015, 8:58:06 AM3/24/15
to tiddl...@googlegroups.com
class="tc-edit-texteditor" is a good way to size it.

Mat

unread,
Mar 24, 2015, 4:13:39 PM3/24/15
to tiddl...@googlegroups.com
Eric, thank you very much! But I can't get it to work.

I made a test case for .myEdit input { width:100%; }
It has an original tiddler with some text, a A1 tiddler with an editor using your suggestion and tiddler A2 with an editor editing A1 so that no open/close of A1 is necessary. Also a CSS where the above is defined.

Also thank you for the clarification of "ignored content". IMO that text should be clarified on this. I'll see if I can do something about it.


@Andres; I did the same thing with your suggestion, if I understood it right: tiddler B1 containing an editor (to edit tiddler Original) and tiddler B2 for editing B1.


<:-)

Andrew

unread,
Mar 24, 2015, 5:24:33 PM3/24/15
to tiddl...@googlegroups.com
<$edit tiddler="Original" field="text" class="tc-edit-texteditor" />

Mat

unread,
Mar 24, 2015, 5:32:38 PM3/24/15
to tiddl...@googlegroups.com
Andrew - it works perfectly and beautifully - thank you!!

<:-)
Reply all
Reply to author
Forward
0 new messages