I want to get the value of the passed filter, in the first code below I set a chapterText
variable which is then combined into littleFilter
, but I don’t get the value I want in the second code. It only outputs [chpater<chpaterText>]
, which I’m using in a different template, so theoretically <<littleFilter>>
should show up as a specific value, like [chapter[01]]
. Strangely, if I display the value of chapterText directly in the procedure, it is able to display it normally, <<chapterText>>
output: 01
. So how do I pass in the display this filter variable?
<$let
stateFilterName={{{ [[$:/state/cluster/chapter/filter/]addsuffix{!!title}] }}}
stateID={{{ [[$:/state/cluster/chapter/]addsuffix{!!title}] }}}
popupstate=<<qualify "$:/state/cluster/chapter/display">>
chapterText={{{ [<currentTiddler>get[chapter]] }}}
stateIDText={{{ [<stateID>get[text]else[-copy]] }}}
rootTag={{{ [<currentTiddler>tags[]tags[]] }}}
captionText={{{ [<currentTiddler>has[caption]get[caption]] }}} >
<$transclude $tiddler="cluster-chapter-button"/>
<$tiddler tiddler=<<currentTiddler>> >
<$transclude $variable="cluster-chapter-procedure" realSuffix=<<stateIDText>> littleFilter="[chapter<chapterText>]" stateFilterName=<<stateFilterName>> rootTag=<<rootTag>> captionText=<<captionText>>/>
</$tiddler>
</$let>
\procedure cluster-chapter-procedure(realSuffix,littleFilter,stateFilterName,rootTag,captionText)
<$let
stateFilterName=<<stateFilterName>>
stateFilter={{{ [<stateFilterName>get[text]] }}}
rootTag=<<rootTag>>
copyTag={{{ [<rootTag>addsuffix<realSuffix>] }}}
filter="[tag<copyTag>filter<littleFilter>] +[search:title<stateFilter>]"
filterCount={{{ [tag<copyTag>filter<littleFilter>] +[search:title<stateFilter>] +[count[]] }}} >
<%if [<filterCount>match[0]] %>
<%if [<stateFilter>is[blank]] %>
<<chapterText>>
<<littleFilter>>
<h2>筛选器 <$text text=`[tag[$(copyTag)$]] +${[<littleFilter>]}$`/> 无内容</h2>
<%else%>
<$button class="grey-dark">
<$action-setfield $tiddler=<<stateFilterName>> text="" />
输入文本错误,请重置搜索框
</$button>
<%endif%>
<%else%>
<$transclude $tiddler="cluster-chapter-display-template" realFilter=<<filter>> captionText=<<captionText>>/>
<%endif%>
</$let>
\end