How to open linked tiddler inside tiddler

Hello everyone,

I have a lot of tiddlers that I created over time tagged “idea”, and I’d like to make it so that a random one could be displayed inside a tiddler (transcluded), and a new one from the list would replace it when i click “random idea” again. (it’s important that it happens inside the tiddler because I would want it in the sidebar while editing other tiddlers)

I found a random tiddler macro by Mohammad on the forum and it works great, it looks like this when I use it <<randomTiddler filter:"[tag[idea]]" label:“random idea”>>

But right now it opens up a random tiddler in the story river and on subsequent clicks it opens new random tiddlers while keeping the old ones open, like a regular link, which is cool, but not what I’d like right now.

Can anyone please help me do this?

you can try this modified version:

\define randomTiddler(filter, label)
<$let seed=<<now XXX>>
      minNum  = 1
      maxNum  = {{{ [subfilter<__filter__>count[]] }}}
      randNum = {{{ [<maxNum>subtract<minNum>multiply<seed>divide[999]add<minNum>round[]]  }}}
>
<$reveal type="nomatch" state="$:/state/randomtid" text="show">
<$button set="$:/state/randomtid" setTo="show">randow</$button>
<$transclude tiddler={{{ [subfilter<__filter__>nth<randNum>] :else[subfilter<__filter__>first[]] }}}/>
</$reveal>
<$reveal type="match" state="$:/state/randomtid" text="show">
<$button set="$:/state/randomtid" setTo="hide">random</$button>
<$transclude tiddler={{{ [subfilter<__filter__>nth<randNum>] :else[subfilter<__filter__>first[]] }}}/>
</$reveal>
</$let>
\end
2 Likes