how can i transclude a variable tiddler?

100 views
Skip to first unread message

Tony K

unread,
May 8, 2020, 5:59:30 AM5/8/20
to TiddlyWiki
I want to transclude a tiddler with title Today's date and put its content into a variable ...

what i tried
        <$transclude tiddler=<<now>> />

works but can't put the resut in a variable

<$set name=content value={{<<now>>}} >

doesn't work

what other options do I have please?

Saq Imtiaz

unread,
May 8, 2020, 7:01:38 AM5/8/20
to TiddlyWiki
<$set name=content value=<<now>> >

Tony K

unread,
May 8, 2020, 7:09:45 AM5/8/20
to TiddlyWiki
this will get me the value of <<now>>  if the variable content right?

what I want is the content of the tiddler with title the restulf of <<now>>

Saq Imtiaz

unread,
May 8, 2020, 7:13:35 AM5/8/20
to TiddlyWiki
try <$transclude tiddler={{{ [<now>] }}} /> but note that the value of now will change every minute.

Tony K

unread,
May 8, 2020, 7:17:03 AM5/8/20
to TiddlyWiki
<$transclude tiddler=<<now>> /> works but i want the result in a variable or field  

TonyM

unread,
May 8, 2020, 8:51:04 AM5/8/20
to TiddlyWiki
Have you thought of using

{{!!title}} to access the current Tiddlers title?

Use this as the value={{!!title}} in a set widget but keep in mind the title equals <<current TIddler>> already

Regards
Tony

Mark S.

unread,
May 8, 2020, 10:37:03 AM5/8/20
to TiddlyWiki
It would help to explain what you actually want to do.

The default <<now>> changes every minute. Do you really have an entire day's worth of tiddlers made in advance that would match <<now>> ? If you just want to fetch contents for the day, then you're going to need to use a format with the macro that limits the output to just the current day.

Good luck!

Mark S.

unread,
May 8, 2020, 1:31:58 PM5/8/20
to TiddlyWiki
In this version it's assumed that you only want to transclude one tiddler for one day, and the format is YYYY-0MM-0DD.

<$wikify name="now2" text=<<now YYYY-0MM-0DD>>>
<
<now2>><br/>
<$set filter="[
<now2>get[text]]" name="curday" select=0>
<
<curday>>
</$set>
</$wikify>

The value of the tiddler ends up in variable <<curday>>

Tony K

unread,
May 8, 2020, 1:52:07 PM5/8/20
to TiddlyWiki
where have you been :)
it is exactly what I was looking for

took me a couple of hours to find it on my own but here was my solution 
<$set name=currentContent  tiddler=<<now YYYY-0MM-0DD>> fied=text>

</$set>
Reply all
Reply to author
Forward
0 new messages