This is a paragraph in the containing tiddler that contains the
<$reveal type="nomatch" state="$:/revealstate" text="show">
<$button set="$:/SampleRevealState2" setTo="show" class="btn-invisible btn-link">link</$button>
</$reveal><$reveal type="match" state="$:/revealstate
" text="show">
<$button set="$:/SampleRevealState2" setTo="hide" class="btn-invisible btn-link">link</$button></$reveal> to reveal the child tiddler. This is some more text to fill up the paragraph.
<$reveal type="nomatch" state="$:/revealstate
" text="show">
</$reveal>
<$reveal type="match" state="$:/revealstate
" text="show">
{{child tiddler}}
</$reveal>
This is a second paragraph in the containing tiddler.
This is a paragraph in the containing tiddler that contains the <<revealmacro "link">> to reveal the child tiddler. This is some more text to fill up the paragraph.
<<revealmacro "{{child tiddler}}">>
This is a second paragraph in the containing tiddler.
\define reveallink(link, state)
<$reveal type="nomatch" state="$state$" text="show">
<$button set="$state$" setTo="show" class="btn-invisible btn-link">
$link$
</$button>
</$reveal>
<$reveal type="match" state="$state$" text="show">
<$button set="$state$" setTo="hide" class="btn-invisible btn-link">
$link$
</$button>
</$reveal>
\end
\define revealtiddler(childtiddler, state) <$reveal type="match" state="$state$" text="show">$childtiddler$</$reveal>
This is a paragraph in the containing tiddler that contains the
<<reveallink "link" "$:/temp/SampleState">> to reveal the child tiddler. This is some more text to fill up the paragraph.
<<revealtiddler "{{child tiddler}}" "$:/temp/SampleState">>
Hi Stephan (and anyone else following along),
I made some minor modifications as follows, setting the system tiddler that holds the reveal-state within the macro rather than within the calling tiddler; the calling tiddler provides a unique "id" parameter for each link/reveal pair.
\define reveallink(id, link)
<$reveal type="nomatch" state="$:/temp/state-$id$" text="show">
<$button set="$:/temp/state-$id$" setTo="show" class="btn-invisible btn-link">
$link$
</$button>
</$reveal>
<$reveal type="match" state="$:/temp/state-$id$" text="show">
<$button set="$:/temp/state-$id$" setTo="hide" class="btn-invisible btn-link">
$link$
</$button>
</$reveal>
\end
\define revealtiddler(id, childtiddler)
<$reveal type="match" state="$:/temp/state-$id$" text="show">$childtiddler$</$reveal>
\end
Usage:
!Paragraph the second
This is a pararaph, with a <<reveallink "rl1" "link">> to another tiddler. More text comes after this. And still more here. Blah blah bladdy blah.
<<revealtiddler "rl1" "{{First child tiddler}}">>
<<revealtiddler "rl2" "{{Second child tiddler}}">>
Here is a second paragraph, and here is another <<reveallink "rt3" "reveal link">>. The child tiddler for this link will be revealed above this paragraph.
Out of curiosity, these "temp" tiddlers that hold the reveal-state, what is the best way to manage those? Should I be concerned if I end up with many of them showing in my sidebar (under System view)?
Thank you again,
-jess
<<reveallink "rl1" "link">>
Out of curiosity, these "temp" tiddlers that hold the reveal-state, what is the best way to manage those? Should I be concerned if I end up with
many of them showing in my sidebar (under System view)?
$:/temp/state-$id$
syntax from an id (the "rl1") passed into the macro as a parameter. I am glad to know there is a solution for preventing these sort of state-tiddlers from being saved. Agreed though, the fact that the creation of these makes the TW "dirty" is a concern.I am already using the$:/temp/state-$id$
syntax from an id (the "rl1") passed into the macro as a parameter.
I am glad to know there is a solution for preventing these sort of state-tiddlers from being saved.
Agreed though, the fact that the creation of these makes the TW "dirty" is a concern.
Is it possible to set a "cookie" from TW5 and use that to save state instead, and therefore prevent the "dirty-ing" of TW?
--
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.
For more options, visit https://groups.google.com/d/optout.
> States under $:/temp/ or $:/state/ don't seem to do that.There are two filters controlling saving TiddlyWiki as a standalone file.* $:/config/SaverFilter determines which modified tiddlers trigger the dirty state* $:/core/save/all determines which tiddlers are saved in the file