Setting the initial state of toggles/fields

44 views
Skip to first unread message

Stephen Kimmel

unread,
Apr 9, 2015, 10:29:34 AM4/9/15
to tiddl...@googlegroups.com
Probably a simple question with a simple answer that I've missed along the way.

I'm using a combination of buttons to toggle the display from one mode to another in much the same way the Show/Hide preview works when editing a Tiddler. For clarity, I'll call it View 1 and View 2. As it currently stands when I reopen a tiddler, I get whatever view goes with the last toggle position as recorded in a field. If I close a tiddler in View 2, it comes up in View 2 when I reopen it. I want it to always open in View 1 regardless of what the position was when I closed the tiddler.

Is there a simple way to force the field to contain a specific value when I open a tiddler?

Danielo Rodríguez

unread,
Apr 9, 2015, 10:39:37 AM4/9/15
to tiddl...@googlegroups.com
You can include the tiddler under the $:/state namespace. The state of those tiddlers is not "saved" 
At least you will get a beautiful empty tiddler every time.

Jeremy Ruston

unread,
Apr 9, 2015, 2:17:26 PM4/9/15
to TiddlyWiki
Hi Stephen

> Is there a simple way to force the field to contain a specific value when I open a tiddler?

No. In fact, in TiddlyWiki it would be wrong for displaying a tiddler to have any side effects on the tiddler store.

> I want it to always open in View 1 regardless of what the position was when I closed the tiddler. 

A slightly different technique than Danielo suggested is to use provide an appropriate value for the "default" attribute of both of the reveal widgets that you're using.

Best wishes

Jeremy.


--
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.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/879b028b-d3ab-4aeb-94d1-0b60b9110e75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com
Reply all
Reply to author
Forward
0 new messages