Is it possible to create a list of tiddlers to transclude in a data dictionary?

110 views
Skip to first unread message

leeand00

unread,
Nov 22, 2017, 9:13:42 AM11/22/17
to TiddlyWiki
Is it possible to list tiddler titles in a data dictionary tiddler, and then transclude just those tiddlers (using a template) somewhere else?   And if so, how would one go about that?

Here is as close as I've gotten with a tiddler named QualificationsSummary:

\define linkup(link,idx)
   
<span id="$idx$_1"> <$view index="$idx$" />
   
<sup><a href="#$idx$"><$text text="$idx$" /></a></sup>
   
</span>
\end

\define what()

   <$list filter="[suffix[$(thefilter)$]]">
      <h2><$link>Qualifications Summary</
$link></h2>
     
<$list filter="[<currentTiddler>indexes[]nsort[]]" variable="thisIndex">
         
<$macrocall $name="linkup" link=<<currentTiddler>> idx=<<thisIndex>>/>
      </
$list>
   
</$list>
\end

<$set name="thefilter" value={{!!tiddlerforqualificationssummary}}>
<<what>>
</
$set>

field: tiddlerforqualificationssummary:

And then it's placed in another tiddler:

{{||QualificationsSummary}}

(with the field

"tiddlerforqualificationssummary" containing the title of the dictionary tiddler)

But this doesn't transclude a list of tiddlers from the dictionary using a template, which is what I would prefer.

Thank you,
   Andrew J. Leer

Mark S.

unread,
Nov 22, 2017, 1:33:57 PM11/22/17
to TiddlyWiki
This seemed to work for me, but maybe I don't understand what you want. It makes a list of tiddlers listed in the data dictionary.

Make sure you have your field name spelled correctly ;-)

Good luck,
Mark

PMario

unread,
Nov 22, 2017, 1:45:09 PM11/22/17
to TiddlyWiki
Hi Andrew,

It's really hard to imagine a functionality, that you want to have, from your description, and code, that does not do what you want. ...

So it would be nice to get a minimal testcase, that also includes a data tiddler. So we don't need to guess and invest time to find out how it may look like, reverse engineering the code. ...

I may have created something similar some time ago, for a video HowTo series. There is a bundle, that you can download and play with. ... The functionality, that may be interesting for you is described in video 12 and 13 that deals with a data dictionary.

video 12 is ~5min long, and describes the functionality. ... So if this is interesting for you, you can have a closer look at vid13.
video 13 is 15min and describes the code in detail.

have fun!
mario


Joshua Fontany

unread,
Nov 22, 2017, 3:21:21 PM11/22/17
to tiddl...@googlegroups.com
Create 3 tiddlers, Test0, Test1, Test2. Put some text into their text fields. Here are the other tiddlers to make the TemplatedList work:

title: DataTiddler
type: application/x-tiddler-dictionary

0:Test0
1:Test1
2:Test2

title: ListTemplate

<div style="float:left; font-weight:bold;"><$transclude field="title" />:</div><div style="clear:right"><$edit-text tag="textarea" field="text" /></div>

title: TemplatedList
datasource: DataTiddler

<$set name="source" value={{!!datasource}} >
<$list filter="[<source>indexes[]]" variable="index">
<$list filter="[<source>getindex<index>]" variable="currentTiddler" template="ListTemplate" />
</$list>
</$set>

[Edit] Save each of those code blocks as a *.tid file & drag them into a wiki to import them, or just remake them yourself. :)

leeand00

unread,
Nov 22, 2017, 3:30:55 PM11/22/17
to TiddlyWiki
Josh, thank you!  That's very clean and very clear.

On Wednesday, 22 November 2017 15:21:21 UTC-5, Joshua Fontany wrote:
Create 3 tiddlers, Test1, Test2, Test3. Put some text into their text field. Here are the other tiddlers to make the TempaltedList work:
Reply all
Reply to author
Forward
0 new messages