how to set the field in the temp tiddler to the value in the target field of my second button.
<$set name="before" filter="[list[lists!!list]before{!!title}]">
<$set name="after" filter="[list[lists!!list]after{!!title}]">
<$button set="lists!!target" setTo=<<before>>>Before</$button>
<$button set="lists!!target" setTo=<<after>>>After</$button>
</$set></$set>
<$view tiddler="lists" field="target"/><$set name="before" filter="[list[lists!!list]last[]][list[lists!!list]before{!!title}]+[last[]]">
<$set name="after" filter="[list[lists!!list]after{!!title}][list[lists!!list]first[]]+[first[]]">
<$button set="lists!!target" setTo=<<before>>>Before</$button>
<$button set="lists!!target" setTo=<<after>>>After</$button>
</$set></$set>
<$view tiddler="lists" field="target"/><$set name="before" filter="[list[lists!!list]last[]][list[lists!!list]before{!!title}]+[last[]]">
<$set name="after" filter="[list[lists!!list]after{!!title}][list[lists!!list]first[]]+[first[]]">
<$button set="$:/StoryList!!list" setTo=<<before>>>Before</$button>
<$button set="$:/StoryList!!list" setTo=<<after>>>After</$button>
</$set></$set>
<$reveal type="match" state="$:/state/Reveal" text="hide">
<$button set="$:/state/Reveal" setTo="show">Next</$button>
</$reveal>
<$reveal type="match" state="$:/state/Reveal" text="show">
<$button set="$:/state/Reveal" setTo="showmeto">Next</$button>
! This is the revealed content
And this is some text
</$reveal>
<$reveal type="match" state="$:/state/Reveal" text="showmeto">
<$button set="$:/state/Reveal" setTo="hide">Next</$button>
! This is the revealed content
And this is some text
</$reveal>
<$reveal type="match" state="$:/state/Reveal" text="showmeto">
! and this is some more revealed content somewhere else
And this is some text
</$reveal>
\define d()
$:/temp/$(currentTiddler)$!!$(a)$
\end
\define toggle-body(a,b,c)
<$vars a="""$a$""" b="""$b$""" c="""$c$""">
<$reveal type="match" state=<<d>> text="">
<$button set=<<d>> setTo=<<b>> class="tc-btn-invisible">
<$transclude tiddler=<<a>> />
</$button>
</$reveal>
<$reveal type="nomatch" state=<<d>> text="">
<$button set=<<d>> setTo={{$c$!!target}} class="tc-btn-invisible">
<$transclude tiddler=<<c>> />
</$button>
</$reveal>
</$vars>
\end
\define toggle(a)
<$macrocall $name="toggle-body" a=$a$ b={{$a$!!target}} c={{$:/temp/$(currentTiddler)$!!$a$}}/>
\end\define d()
$:/temp/$(currentTiddler)$!!$(a)$
\end
\define toggle(button)
<$vars a="""$button$""" b="""{{$button$!!target}}""" c="""{{$:/temp/$(currentTiddler)$!!$button$}}""">
<$reveal type="match" state=<<d>> text="">
<$button set=<<d>> setTo=<<b>> class="tc-btn-invisible">
<$transclude tiddler=<<a>> />
</$button>
</$reveal>
<$reveal type="nomatch" state=<<d>> text="">
<$button set=<<d>> setTo={{$c$!!target}} class="tc-btn-invisible">
<$transclude tiddler=<<c>> />
</$button>
</$reveal>
</$vars>
\end\define toggle(button, altbutton)
<$reveal type="match" state="$:/temp!!$button$" text="show">
<$button set="$:/temp!!$button$" setTo="hide" class="tc-btn-invisible">
<$transclude tiddler="$button$"/>
</$button>
</$reveal>
<$reveal type="match" state="$:/temp!!$button$" text="hide">
<$button set="$:/temp!!$button$" setTo="show" class="tc-btn-invisible">
<$transclude tiddler="$altbutton$" />
</$button>
</$reveal>
\end
<<toggle "Content" "OtherContent">>I was wondering if you might know how to use the double bars || to declare in a macro something like...
\define some-macro(x,y)<$list filter="[all[current]has[$x$]]">{{$x$||some-template}}</$list><$list filter="[all[current]!has[$x$]]">{{$y$||some-template}}</$list>\endI want to set the value of $c$ to the value of $a$ if $s$ is null or empty.
\define some-macro(some-tiddler,some-field,some-variable,some-value)<$list filter="[<$some-tiddler$>has[$some-field$]"><$set name="""$some-variable$""" value="$some-value$""">what you actually want to do needs to be here, inside the $set, e.g.{{||some-template}}</$set></$list>\end