It graphically expands each of the listed tiddlers’ contents when you click each title (as opposed to just being a typical Table of Contents of titles)
Checkbox State Gets Created for the Global Macro Tiddler
This has come down to one thing: how to use a variable or parameter in order to specify a dynamic field name after two exclamation marks for the reveal state
I tried:
- using the parameter
- <$reveal state="!!$param$"
- using a variable to concatenate the exclamation marks
- value=’!!$param$’
- or: value=’"!!$param$"’
- <$reveal state="$(variable)$"
- or: <$reveal state=".<.<variable.>.>"
- removing the quotes brakes it
(The fields and field values get successfully created. But it is simply does not seem syntactic to use a param or var in order to dynamically create a field name.)
-
Note: It works if you manually enter one of the dynamically created fields:
- state="!!st-210671450"
$:/tags/Macro
\define XPD-List(tagged:"help" stnam:"<<qualify st>>" headr:"2" clr:"grey" brd:"2")
<$set name="streveal" value='!!$stnam$' >
$stnam$
<$list filter="[tag[$tagged$]sort[title]] -[regexp:title[^Draft of \'.*]]">
<style type="text/css">
.exheading [type="checkbox"]{display:none;}
</style>
<div class="exheading" style="position:relative;">
<$checkbox field=$stnam$ checked="yes" unchecked="no">
<h$headr$ style="border-radius:4px; text-decoration:none; border:0px; margin-top:6px; margin-bottom:4px; padding-left:6px; padding-top:6px; padding-bottom:2px; background-color:$clr$;">
{{$:/core/images/unfold-button}}
<$transclude field="title" mode="inline"/> <<stnam>> <<streveal>> <span style="position: absolute; right: 10px; font-size:smaller;"><$link>[edit]</$link></span>
</h$headr$>
</$checkbox>
</div>
<div style="border-left:$brd$px solid $clr$; margin-left:25px; padding-left:30px; margin-right:15px;">
<$reveal state="$(streveal)$" type="match" text="yes">
<$transclude field="text" mode="block"/>
</$reveal>
</div>
</$list>
</$set>
\end
<<XPD-List tagged:"Wiki Related" stnam:"<<qualify st>>" clr:"grey" brdr:"2" headr:"2">>
Just using a tag list, you can create menu/s of expanding sections. The expanding tiddlers are best kept quite short, like:
- quick summaries
- Title-based TOCs
- multiple topical todo lists
In addition to changing the tag or filter, it can be useful to change the heading level.
Macro Params
I don’t get the procedures yet.
- tagged: The list’s tag
-
stnam: State Tiddler Name
- default is “<.<.qualify st>.>.” (minus the periods)
- Might be helpful to declare at the time of the macro call
-
clr: color of the heading background, and the content’s left border
- optional: default is “grey”
-
brdr: the content’s left border width
- optional: default is 2, as in 2px
- zero makes it go away
I use it multiple times with a CSS grid class:
<div class="gridivs">
<div>
! List-A Heading
<<macro call>>
</div>
<div>
! List-B Heading
<<macro call>>
</div>
</div>
Grid CSS
.gridivs {
display: grid;
grid-gap: 30px;
grid-auto-flow: row;
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}
CSS Quirks
As this is right now, the divs do not allow putting the CSS styles anywhere but in the html elements. It might be a block and/or inheritance issue.