[tw5] Process contents of a field before transclusion

A tiddler ‘King George’ contains a field ‘family-members’ that has the value [[Mary]] [[Henry]].

The code

<$list filter="[get{!!family-members}]">
#{{!!title}}
</$list>

produces

#Mary #Henry

I want to put this code in a tiddler ‘HashTaggedFamilyMembers’ and use that as a template tiddler. So, I can put

{{||HashTaggedFamilyMembers}}

in any tiddler and get the list of family members with # before each name.

Of course, if there is an easier way of doing it, please let me know. But it needs to have transclusion.

Hello Sandip, which part isn’t working for you? By your description it seems to work as you describe. My filter text is a little different using enlist, but otherwise as you decribe it?

Hello Stobot,

I wanted to modify ‘HashTaggedFamilyMembers’ and convert it into a template.

Then I would be able to transclude it in any tiddler like

{{||HashTaggedFamilyMembers}}

and produce list of family-members of that tiddler with # before each name.

I’m not able to do that.

Hi Sandip - hmm well what I posted does what you’re asking for unless I’m misunderstanding… Is it possible it’s just simpler than you thought? In the screenshot the bottom tiddler is what you describe, and in the top one I’m using the bottom one as a template and it’s indeed returning the list of family members (in that case Adam and John) prefixed with # as desired.

Regarding “turn it into a template”, I think it’s worth noting as there’s nothing you have to do to “convert” it, in fact ALL tiddlers can be used as templates.

Sorry that I’m not understanding what you’re trying to do. I must be missing something.

Stobot,

My most sincere apologies.

Instead of transcluding the tiddler through the template, I was transcluding the template.

In other words, I was missing ‘||’

I’ve added that and everything is working as expected.

Thanks for all your help.

1 Like