Now Published here Tips and commentary - Notes on tiddlers stored in a data tiddler
I had an idea for a simple solution that is simple, very useful and demonstrates a few code patterns, however it has three problems;
- Despite the button being at the top, clicking in the edit field is triggering a close
- For viewing the text the transclude widget is not processing the newlines
\nfound in the content retrieved from the data tiddler - I need to see if Relink can handled the rename of titles in data tiddlers?
All three of these problems will shed light on issues the code patterns may give rise to.
- It exposes the possibility of storing multiline fields in data tiddlers whilst using the $index parameter on the editWidget.
- Later I may test using an editor with a toolbar for the same
\function notes.popup.tiddler() [<qualify $:/temp/edit-notes>]
\define note.database() $:/note.database
\procedure view/edit.notes()
<$button popup=<<notes.popup.tiddler>> tooltip="view/edit.notes for this tiddler" tag=div>
<%if [<notes.popup.tiddler>has[title]] %>
<button>View Notes</button>
<%else%>
<button>Edit Notes</button>
<%endif%>
</$button>
<hr>
<div>
<%if [<notes.popup.tiddler>has[title]] %>
<$edit tiddler=<<note.database>> index=<<currentTiddler>> class="tc-edit-texteditor"/>
<%else%>
<div>
<$transclude $tiddler=<<note.database>> $index=<<currentTiddler>> mode=block/>
</div>
<%endif%>
</div>
\end view/edit.notes
<<view/edit.notes>>
- Paste this into a tiddler to test.
Once this is fixed
- I need to see if we can use Quotes
" "inside the notes as this is what delimits the value in the data tiddler. - [edited] I note that Quotes are delimited with
\"
thanks

