[5] is there an alternate syntax to {{TiddlerName}} ?

159 views
Skip to first unread message

Mike Wright

unread,
Jan 8, 2017, 11:25:55 PM1/8/17
to TiddlyWiki
Hi everybody,

I've managed to use a template to create some tiddlers.  It works well.  The created tiddlers also work inside other tiddlers when called like this {{myTemplatedTiddler}} but doesn't work inside the <$tabs> macro.

Sooo, I'm trying to recycle the <$tabs> macro into <$myTabs> to avoid the transclusions.

There is <<currentTab>> available to me and I need to put it inside {{ }} but that doesn't work.  I've tested that I get the desired results if I just type in a {{tiddler name}} so now I have to figure out how to represent something like  {{<<currentTab>>}}.

Any helpers?

Thanks,
Mike Wright

Tobias Beer

unread,
Jan 9, 2017, 5:43:58 AM1/9/17
to tiddl...@googlegroups.com
Hi Mike,

You could wrap your template like so to redefine the value of the currentTiddler variable to be that of currentTab while storing the tiddler containing the tabs in a variable called tabsTiddler, should you need it.

title: $:/_my/template/some-tabs

<$vars tabsTiddler=<<currentTiddler>>>
<$set name="currentTiddler" filter="[<currentTab>]" emptyValue=<<currentTiddler>>>

; tabsTiddler
: <<tabsTiddler>>
; currentTiddler
: <<currentTiddler>>
; currentTab
: <<currentTab>>

</$set>
</
$vars>

This should allow you to use your template inside or outside tabs.

Here's a tiddler to test:

title: SomeTabs

<<tabs "foo bar baz" "foo" "$:/state/tabs/some-tabs" template:"$:/_my/template/some-tabs">>

Best wishes,

Tobias.

Tobias Beer

unread,
Jan 9, 2017, 6:31:46 AM1/9/17
to TiddlyWiki
Hi Mike,

Added my last response as a tutorial here:


Best wishes,

Tobias.

Danielo Rodríguez

unread,
Jan 9, 2017, 1:23:46 PM1/9/17
to TiddlyWiki
I recently added some documentation regarding this topic to the tabs macro official tiddler. Jeremy has merged the master with it already. Could you check it and let me know if it helps?

Mike Wright

unread,
Jan 9, 2017, 10:04:12 PM1/9/17
to TiddlyWiki


On Monday, January 9, 2017 at 10:23:46 AM UTC-8, Danielo Rodríguez wrote:
I recently added some documentation regarding this topic to the tabs macro official tiddler. Jeremy has merged the master with it already. Could you check it and let me know if it helps?

Hi Danielo, I'd be happy to.  I'm still finding my way around TW5 so can you be more specific about where to look? i.e. version, tiddler name, etc. I have the standard distribution of 5.1.13 here and keep tiddlywiki.com/#Reference open all the time.

-mw 

Danielo Rodríguez

unread,
Jan 10, 2017, 2:56:37 AM1/10/17
to TiddlyWiki
Sorry Mike, here is the link to the reference I was talking about:


It's the last paragraph.

Mike Wright

unread,
Jan 10, 2017, 11:00:34 AM1/10/17
to TiddlyWiki
Awesome Danielo,

That was clear and easy to implement and saved me a lot of head banging.

I wrapped it around my template (nuTube) contents, created a "New Movie" tiddler whose only contents are {{||nuTube}} and 4 fields, which was automagickally picked up by my player as a "tab" and the movie tiddler now renders perfectly.

By combining my template with Skeeve's <$newTiddler/> I'll have a form front end that carries through the intermediate tiddlers until being picked up by the player.

Happy camper here,
-mw

Danielo Rodríguez

unread,
Jan 10, 2017, 1:50:34 PM1/10/17
to TiddlyWiki
Glad it helped!
Regards
Reply all
Reply to author
Forward
0 new messages