Textfield within a tiddler?

61 views
Skip to first unread message

Stephan Hradek

unread,
Nov 28, 2012, 4:01:22 AM11/28/12
to tiddl...@googlegroups.com
Sorry if it's explained somewhere, I couldn't find it, maybe I'm using the wrong search terms.

I want my tiddler to contain a text field so that the user can enter some information. Similar to what the empty TiddlyWiki has for the username.

Is it okay to use <<option txtMyFieldName>>? Or is there another way?

And how do I access the values from within another tiddler?

Many thanks in advance...

passingby

unread,
Dec 7, 2012, 11:50:37 AM12/7/12
to tiddl...@googlegroups.com
Install the taggedTemplateTweak Plugin from Tiddlytools. With this you can make a tiddler show up with customized ViewTemplate or EditTemplate(please read the documentation on tiddlytools). As an example take a look at this EditTemplate I am using:


<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div macro='annotations'></div>
<table>
<tr><td>What:</td><td><span class='editor' macro='edit title'></span></td></tr>
<tr><td>When:</td><td>
Date:<span macro='select event_date rows:1 *DatesList'></span>
Month:<span class='editor' macro='select event_month rows:1 *MonthsList'></span>
Year:<span class='editor' macro='select event_year rows:1 *YearsList'></span>
</td></tr>
<tr><td>Where:</td><td><span class='editor' macro='edit event_where'></span></td></tr>
<tr><td>Why:</td><td><span class='editor' macro='edit event_why 5'></span></td></tr>
<tr><td>Who:</td><td><span class='editor' macro='edit event_who'></span></td></tr>
<tr><td>How:</td><td><span class='editor' macro='edit event_how 5'></span></td></tr>
</table>
<div style="display:none" class='editor' macro='edit tags'></div>
<!--}}}-->
 
When we write something like this in the template <span ......macro='edit foo'></span> It creates an HTML textbox and creates a field named foo which will store the value from that textbox for that tiddler. The value can then be accessed using inline javascript with : var field_value= store.getTiddler('TiddlerName').fields.foo; from any tiddler which contains this inline script.
Hope this helps.

Stephan Hradek

unread,
Dec 7, 2012, 1:26:21 PM12/7/12
to tiddl...@googlegroups.com
Sounds great! As soon as I get my TiddlyWki update probleme sorted, I'll give it a try.

Thank you.
Reply all
Reply to author
Forward
0 new messages