Hi Tony,
You probably solved your issue since, but in case you didn't, I just wanted
to state for the record that it was a perfect job for the *subfilter*
operator:
\define transcludeTag() [<currentTiddler>addprefix[$:/autotag/transclude/]]
$:/autotag/transclude transcluding items tagged {{{
[subfilter<transcludeTag>] }}}<br/>
<$list filter="[subfilter<transcludeTag>tagging[]]"
variable="transcludeTiddler">
hi <<transcludeTiddler>> <$transclude tiddler=<<transcludeTiddler>>
mode=block />
</$list>
Since *subfilter* role is to plug filter strings into other filters, the
computation of the filter result is delayed until necessary, first to
display it thanks to the {{{}}} construct, then to feed it to the list
widget as part of its filter attribute.
However, this power may have a drawback if we are not cautious: since the
computation of [<currentTiddler>] is delayed, let's say you didn't give an
explicit variable name to the list widget, and rather wanted to rely on it
to set currentTiddler and pass it to its content:
\define transcludeTag() [<currentTiddler>addprefix[$:/autotag/transclude/]]
$:/autotag/transclude transcluding items tagged {{{
[subfilter<transcludeTag>] }}}<br/>
(outside the list widget, ''<$text text="[subfilter<transcludeTag>]"/>''
gives {{{ [subfilter<transcludeTag>] }}})<br/>
<$list filter="[subfilter<transcludeTag>tagging[]]">
hi <<currentTiddler>> <$transclude mode=block />
(inside the list widget, ''<$text text="[subfilter<transcludeTag>]"/>''
gives {{{ [subfilter<transcludeTag>] }}})
</$list>
Because the currentTiddler value changes when entering the list widget, so
does the value of any included filters that contain a reference to
currentTiddler.
Best,
-- Xavier Cazin
On Sun, Dec 29, 2019 at 9:50 AM TonyM <[email protected]> wrote:
> Folks,
>
> In the following code I just can't get the list widget to display its
> contents, including "hi" and transclude all tiddlers tagged with transcludeTag
> or
> \define transcludeTag() {{{
> [<currentTiddler>addprefix[$:/autotag/transclude/]] }}}
> $:/autotag/transclude transcluding items tagged <<transcludeTag>><br>
> <$wikify name=tagname text="{{{ [<transcludeTag>] }}}">
> tagname = "<<tagname>>"<br>
> <$list filter="[<tagname>tagging[]]" variable="transcludeTiddler">
> hi <<transcludeTiddler>> <$transclude tiddler=<<transcludeTiddler>>
> mode=block />
> </$list>
> </$wikify>
>
> The tagname displays correctly but does not work in the filter also using
> "[tag<tagname>]" or [tag<transcludeTag>]"
> If I place the literal name in the filter it works eg
> "[tag[$:/autotag/transclude/New Tiddler 7]]"
>
> I thought I needed to use the wikify widget but no,
>
> What do you think?
>
> Thanks in advance
> Tony
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/0ee38a64-297c-4d83-b809-68619d1fda17%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/0ee38a64-297c-4d83-b809-68619d1fda17%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/CADeSwYN2Og2YrAtzu9nh76uNPu3OB%2BFLoiUJh33PqjN8A63UXQ%40mail.gmail.com.