Using a field value as the index to a data tiddler

88 views
Skip to first unread message

Linda Moss

unread,
Nov 16, 2018, 8:21:32 PM11/16/18
to tiddl...@googlegroups.com
Hey, I've been trying to figure this out, but not getting anywhere.

How do I reference an item from a data dictionary tiddler, using the value of a field as the index?

(unsurprisingly) this doesn't work:

    {{data-tiddler##{{!!field-name}}}}

because the curlybrackets don't nest like that. Ive also tried:

    {{data-tiddler##!!field-name}}

Which is also incorrect.

I've been unable to find an alternate way to reference the data tiddler index, which would let me use the {{!!field-name}}, without nesting curly brackets. Is there a way to do this?

Thanks!

Mark S.

unread,
Nov 17, 2018, 12:44:02 AM11/17/18
to TiddlyWiki
Once you get beyond a certain level of complexity, it's probably better to use widgets than wikitext. e.g

<$transclude tiddler="data-data" index={{!!field-name}}/>

Good luck!
-- Mark

BurningTreeC

unread,
Nov 17, 2018, 12:45:09 AM11/17/18
to TiddlyWiki
Hi Linda, you could use the transclude widget directly ( the {{ }} syntax is just a short form of it) :

<$transclude tiddler="data-tiddler" index={{!!field-name}}/>

see https://tiddlywiki.com/#TranscludeWidget

Simon

Linda Moss

unread,
Nov 17, 2018, 7:55:23 AM11/17/18
to TiddlyWiki

Ah, thanks!

I hadn't been thinking of it as a transclusion, which is why I didn't get anywhere while looking for an alternate way to access a data field.

Though in hindsight, the fact that it used the same wikitext as transclusion probably should have been a hint...

(Note: I can see the green-mark-as-resolved-check-button on posts in some threads, but for some reason never on posts in threads I started)
Reply all
Reply to author
Forward
0 new messages