Template and variable usage question

85 views
Skip to first unread message

Peter Ajtai

unread,
Oct 2, 2018, 4:32:24 PM10/2/18
to TiddlyWiki
Hi, each day I tag all my tiddlers with the appropriate tags and a tag for the day: e.g. "2018-10-01"

I have a tiddler I use that looks like:

<$set name=dateToday value="2018-10-01">
    <$list filter="[tag<dateToday>]">
        <h2><$link><$transclude field="title" mode="block"/></$link></h2>
        <$transclude mode="block"/>
    </$list>
<$set>

!! Misc Notes



How can I reuse the above tiddler with value="2018-10-01" being replaced by an incoming variable from another tiddler?

For example I envision using the above tiddler - let's call it DailyTiddler something like:

{{{ 2018-10-02 || DailyTiddler }}}

Is this possible? How would I reference the incoming variable in DailyTiddler?

I feel like the answer might be here: https://tiddlywiki.com/static/Transclusion%2520in%2520WikiText.html , but I can't quite piece it together.

Thanks,
Peter.

Mark S.

unread,
Oct 2, 2018, 5:23:28 PM10/2/18
to TiddlyWiki
Used that way, the value passed in the transclusion becomes the "currentTiddler" for your DailyTiddler template. So this minor change:

<$set name=dateToday value=<<currentTiddler>>>
    <$list filter="[tag
<dateToday>]">
       
<h2><$link><$transclude field="title" mode="block"/></$link></h2>

        <$transclude mode="block"/>
    </$list>
<$set>

Should let you do what you want.

-- Mark

Peter Ajtai

unread,
Oct 2, 2018, 9:06:11 PM10/2/18
to TiddlyWiki
Yes, that worked! Thanks for the quick reply.
Reply all
Reply to author
Forward
0 new messages