What I’m running into now is that when the detailState macro is rendered, it is expanding the Boolean attribute “open” into “open=true”. Thus when I have collapsed all of my details elements via a TW button but open one of them with the native disclosure widget, I can get a state like this:
<details class="bookitem journalitem" closed="true" open>
</details>
Wondering if there is a way to use the wikify widget inside the macro to prevent this substitution.
Here’s my code in full again.
\define sortdirection()
[all[current]tagging[]tag[journal-entry]$(SortType)$[created]]
\end
\define detailContent()
<summary>
<div class='serif upone'><$link /></div>
<div class='excerpt'>
<$wikify name="snapshot" mode="inline" text="<<firstLine>>" output="html"><<snapshot>></$wikify>
</div>
</summary>
<$wikify name="remnanttext" mode="block" text="<<remnant>>" output="html"><<remnanttext>></$wikify>
\end
\define detailState(openclosed:"closed")
<details class='bookitem journalitem' $openclosed$>
<<detailContent>>
</details>
\end
<$set name=SortType filter='[<currentTiddler>get[sortorder]]'>
<$list filter="[is[current]tag[journal]]">
<$button>
<$action-listops $field="sortorder" $subfilter="+[toggle[sort],[!sort]]" />
Sort {{$:/images/google-material-design/av/outlined/24px/loop}}
</$button>
<$button>
<$action-setfield $tiddler="$:/jenn/states/journalDetails" text="open"/>
Open All
</$button>
<$button>
<$action-setfield $tiddler="$:/jenn/states/journalDetails" text=""/>
Close All
</$button>
<div class='spacer1'></div>
<div class='grid_auto_1'>
<$list filter=<<sortdirection>>>
<div>
<$view format="date" template="MM/DD/YY" field="created"/>
</div>
<div>
<$list filter="[{!!text}splitbefore[. ]]" variable="firstLine">
<$list filter="[{!!text}trim<firstLine>]" variable="remnant">
<$list filter="[<remnant>length[]compare:number:ne[0]]" variable="remnantsize">
<$macrocall $name=detailState openclosed={{$:/jenn/states/journalDetails}} />
</$list>
<$list filter="[<remnant>length[]compare:number:eq[0]]" variable="remnantsize">
<div class='serif upone'><$link /></div>
<div class='excerpt'>
<$wikify name="snapshot" mode="inline" text="<<firstLine>>" output="html"><<snapshot>></$wikify>
</div>
</$list>
</$list>
</$list>
</div>
</$list>
</div>
</$list>
</$set>
I am hoping to make use of the native HTML display routine. Although this details element is a very peculiar HTML element, and is almost a widget of its own.