[tw5] Convert a dynamic list into a template

Here is a working dynamic list I have:

    <$list filter="[contains:participants[King George]!sort[at]]">
  • <$link />

This works perfectly.

Can I convert this into a template — ‘ParticipatedListTemplate’?

So, I can sit in a tiddler ‘King George’, write

{{||ParticipatedListTemplate}} and get the same list.

And if it is a template, I can do the same in ‘Queen Elizabeth’ tiddler, too.

Or is there a better way of achieving the same thing?

Try

    <$list filter="[contains:participants!sort[at]]">
  • <$link />

If that works inside tiddler “King George”, then you can paste the text into a tiddler and tag it “$:/tags/ViewTemplate” and it will work everywhere. But you probably don’t want it to work everywhere. So you can wrap it with a list that only includes tiddlers that have participants :

<$list filter="[all[current]has[participants]]">

    <$list filter="[contains:participants!sort[at]]">
  • <$link />

</$list>

Thanks, Mark.

Try

    <$list filter="[contains:participants!sort[at]]">
  • <$link />

The first block of code worked perfectly.

If that works inside tiddler “King George”, then you can paste the text into a tiddler and tag it “$:/tags/ViewTemplate” and it will work everywhere. But you probably don’t want it to work everywhere. So you can wrap it with a list that only includes tiddlers that have participants :

<$list filter="[all[current]has[participants]]">

    <$list filter="[contains:participants!sort[at]]">
  • <$link />

</$list>

But this did not. I had named the tiddler containing this code ‘ParticipatedList’ and tagged it as suggested by you.

Also, what I am aiming at is not the list. I want to transclude the matching tiddlers.

I have edited the original question to say so explicitly. I earlier thought that {{}} meant it automatically.

Can you provide some tiddlers with participants list (e.g. King George, Queen Elizabeth, etc.) Having to guess at someone’s data structure makes helping difficult.

Thanks!

Well, I found a solution to the problem!!

Here is what I have done:

ContactInformation tiddler carries this code:

<$list filter="[contains:participants!sort[on]]">
<$link />

{{!!text}}




</$list>

Every time I want to extract this information for a particular tiddler, I just put:

{{||ContactInformation}}

in it. Then it works.