Also try this for a quick way to edit in the view mode a field on the
current tiddler
QuickFieldEdit - edit-field-list
Place this in a tiddler tagged $:/tags/ViewTemplate
<$list filter="[all[current]has[edit-field-list]]" variable=nul>
<$list filter={{!!edit-field-list}} variable=named-field>
<<named-field>> <$edit-text field=<<named-field>>/><br>
</$list>
</$list>
Now in any tiddler place a list of field names (space separated) in a field
called edit-field-list eg
caption description
And you can edit these as text fields in the view mode.
Regards
Tony
On Tuesday, July 23, 2019 at 10:24:17 AM UTC+10, TonyM wrote:
>
> Editing fields in the current Tiddler in view mode is tricky at the
> beginning because the field you are editing keeps loosing focus.
>
> Here is a quick solution to this issue.
>
> The simplest approach is to place the following in a tiddler tagged
> $:/tags/ViewTemplate
> <$edit-text field="description"/>
>
> Then wrap the above in a list widget to have it appear selectively such as
> only on tiddlers that already have the description field.
>
> Alternatively place he above in a template tiddler and transclude that In
> the *view template tiddler*
>
> in a tiddler tagged $:/tags/ViewTemplate
> {{||yourtemplate}}
> However if you use the above directly (typed in the body) in a random
> tiddler you will experience the same lost of focus issue.
>
> Using it through the view template works because what you are looking at
> is the rendering of the view template not your current tiddler.
> You may want to fold the tiddler so you do not see the content twice.
>
> Templates have the advantage of being able to have edits for multiple
> fields without making the view template tiddlers any more complex. eg
> Using template:<br>
> Description: <$edit-text field="description"/><br>
> Caption: <$edit-text field="caption"/><br>
>
>
> One way to make it possible to decide in any given tiddler if you want to
> edit a field in the current tiddler, when in view mode, is to create a
> field in any given tiddler called viewtemplate and name your view template
> eg viewtemplate: testTemplate
>
> Then to activate this add to a tiddler tagged $:/tags/ViewTemplate
>
> <$list filter="[all[current]has[viewtemplate]get[viewtemplate]]"
> variable="view-template">
> <$transclude tiddler=<<view-template>>/>
> </$list>
> So if the template is named in any tiddler the view template will
> transclude that template. You may want to add a list-before field with the
> value $:/core/ui/ViewTemplate/body in the tiddler tagged
> $:/tags/ViewTemplate
>
> What is nice is if the fields do not exist they are silently created.
>
> If you create your own new tiddler button you can set the viewtemplate
> field at creation or use a template to create your tiddlers with the view
> template already set. Or just clone an existing tiddler.
>
> Regards
> Tony
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/1bf3b14c-2320-455f-ae40-0074e8d83f6e%40googlegroups.com.