<!-- Macro to compute the filter -->
\define myfilter(namespace:"mp:") <$list filter="[prefix[$namespace$]] +[field:text[Yes]] +[removeprefix[$namespace$]]"
emptyMessage="No path set!">tag[<<currentTiddler>>]</$list> \end<!-- Macro to display the filtered tiddlers -->\define mytiddlers(filter) <$list filter="[$filter$]"> </$list> \end
I was hoping to display a list of tiddlers that matched the filter computed in the myfilter macro,
but <$macrocall $name="mytiddlers" filter=<<myfilter>> /> keeps returning
the (correctly) instanciated code of mytiddlers,
say <$list filter="[tag[english]tag[power user]]"> </$list>,
instead of the actual list of tiddlers.
Is there a way solve this kind of issue?
Thanks in advance!
Here are my two tentative macros again. namespace is nothing more than a way to extract tags from configuration tiddler titles:
<!-- Macro to compute the filter -->
\define myfilter(namespace:"mp:") <$list filter="[prefix[$namespace$]] +[field:text[Yes]] +[removeprefix[$namespace$]]"
emptyMessage="No path set!">tag[<<currentTiddler>>]</$list> \end<!-- Macro to display the filtered tiddlers -->\define mytiddlers(filter) <$list filter="[$filter$]"> </$list> \end
Jed's suggestion to use <$set/> rather than <$list/> sounds like a better approach but then I have trouble figuring how I could build my filter out of any number of settings.
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/cf3d8ba3-fa82-4b4f-a401-ac979b7ea526%40googlegroups.com.
<$vars selected={{$:/states/selected-tags}}>
<$list filter="[contains:tags $all<selected>sort[title]]">
...do your thing...
</$list>
</$vars>
<$vars selected="Filters Plugins">
<dl>
<$list filter="[contains:tags $all<selected>sort[title]]">
<dt><$link><$view field="title"/></$link></dt>
<dd>''field:'' {{!!tags}}</dd>
</$list>
</dl>
</$vars>\define state() $:/state/selected/tags/$(tag)$
Select tags to constrain results...
<$set name="selected" filter="[prefix[$:/state/selected/tags/]has[text]removeprefix[$:/state/selected/tags/]]"><$reveal type="match" default=<<selected>> text=""><$list filter="[tag[Plugins]tags[]sort[title]]" variable="tag"><$checkbox tiddler=<<state>> field="text" checked="true" unchecked=""><$text text=<<tag>>/></$checkbox></$list></$reveal><$reveal type="nomatch" default=<<selected>> text=""><$list filter="[contains:tags $all<selected>tags[]!title[Plugins]sort[title]]" variable="tag"><$checkbox tiddler=<<state>> field="text" checked="true" unchecked=""><$text text=<<tag>>/></$checkbox></$list></$reveal>
<dl><$list filter="[contains:tags $all<selected>sort[title]]"><dt><$link><$view field="title"/></$link></dt><dd class="tb-links">''tags:'' {{{ [all[current]tags[]!title[Plugins]] }}}</dd></$list></dl></$set>--
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+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c2a65baf-a372-4c05-90b3-b5ee2f65d6b6%40googlegroups.com.