is a drop-down Field selector menu possible in Draft Mode?

143 views
Skip to first unread message

david...

unread,
May 11, 2015, 1:48:22 AM5/11/15
to tiddl...@googlegroups.com
Hi List,
 
Can I use a drop-down selector for the Fields, in Draft Mode? Is it possible?
 
I've added two fields ('Probability' and 'Severity') to my default 'New Tiddler' template, by following Tobias Beer's excellent guide to Create a Tiddler from a Template.
 
I'd like to be able to select the value for each field from a drop-down menu selector. Ideally, the selector would appear when the tiddler was in Draft Mode.
 
I thought I could use the instructions given in tiddlywiki.com#SelectWidget. I guess this will only show the code in Draft Mode, though. Is that correct, or is there some way to use the SelectWidget in Draft Mode, too?
 
By the way, what is the opposite of Draft Mode? Is it View Mode, Presentation Mode, or something else?
 
Cheers,
 
David.
 
 

david...

unread,
May 12, 2015, 4:53:53 PM5/12/15
to tiddl...@googlegroups.com
So I've worked out a solution based on Dave Gifford's example of using the SelectWidget to set fields.
 
The dropdown menu only appears in View Mode of course, but changes made show up in the fields in Draft Mode, so I guess it's doing what I need it too. I'd still rather the changes could only be made in Draft Mode, but this seems to work.
 
I now have the code below[1] to set the value field for 'probability', and a similar one to set the value for 'severity'.
 
My next step is to place the code for each group of values in a separate tiddler, so that I can reference them (transclude them?) into each tiddler that I require values set for. I'm doing this so I can easily change or update the values across multiple tiddlers.
 
Any hints or tips appreciated!
 
Cheers,
 
David.
 
[1]
<$select field='probability'>
<option><$action-setfield probability/>1-rarely</option>
<option><$action-setfield probability/>2-unlikely</option>
<option><$action-setfield probability/>3-sometimes</option>
<option><$action-setfield probability/>4-likely</option>
<option><$action-setfield probability/>5-frequently</option>
</$select>
--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
 

Måns

unread,
May 12, 2015, 6:41:44 PM5/12/15
to tiddl...@googlegroups.com, gro...@tag.eml.cc
Hi David

If you tag your template with: $:/tags/EditTemplate it will show in edit mode in all tiddlers.
When you want to decide where the select box should appear you can use the list-before or list-after fieldname and add the title of the element which you will position it relative to... You can find a list of element titles in the list field of the shadow tiddler  $:/tags/EditTemplate.

You can also create a macro and a template with variables which can be used to create different fieldname and different values too:
I've setup a working example here: http://playground.tiddlyspot.com (based on your data)

Notice that you don't actually need to add the tag $:/tags/Macro unless you want to use the macro in reader mode in other tiddlers and with other values for the variables...  

Cheers Måns Mårtensson

Danielo Rodríguez

unread,
May 14, 2015, 12:27:33 PM5/14/15
to tiddl...@googlegroups.com
Hello,

In my opinion what is needed for the field's field is the same we have with the type field. A drop down list of already available values. I asked this a while before and Jeremy suggested me a pull request. There is something that is on my list, I just to find the time to do so.
Reply all
Reply to author
Forward
0 new messages