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/fcd3a76c-dfbf-4a0d-80f7-b558f89e3a99%40googlegroups.com.

Reply via email to