Wikipedia-styled auto citation numbering?

Just a quick question for something I can’t seem to figure out.

I’ve created a tiddler, let’s call it “Topic”, and using the code below, I want to transclude the text fields of every tiddler tagged with “Topic”, and at the end of each text transclusion, include ^^(n)^^ where n is the citation number. for instance, the first transclusion would be 1, then the 2nd one would be 2, etc.

The code I have so far is:

\procedure tv-wikilink-tooltip()
<$transclude field="tooltip"><$transclude field="title"/></$transclude>
\end
<!-- above for citation numbers to show the title of the transcluded tiddler -->

<$list filter="[all[tiddlers]!is[system]tag[Topic]sort{Topic!!list}]"> 
<!-- sort present so when reordered using the tag, it would reorder the transclusions -->

<$transclude> ^^<$link to=<<currentTiddler>>>({{{ [<currentTiddler>count[]] }}})</$link>^^

</$list>

Right now {{{ [<currentTiddler>count[]] }}} is there as a placeholder and to show what it is sort supposed to look like, except that it isn’t numbering each transclusion.

I imagine if a solution is possible, I can then use it to also create a footer section where it’s something like: (this is Not functional code, just a very rough thought)

!! References
(citation numbering formula). "<$link to=<<currentCitationTiddler>>/>"

My overall goal is to have a template of sorts, where I can create a wikipedia-style page for topics that I am keeping in my tiddlywiki. I’ll probably need to revisit again to see if it would be possible to have the citations at the bottom in the references to use anchor links :thinking: one obstacle at a time, IG.

I am not exactly sure how to go about doing (frankly all of) this, and would appreciate the guidance of the community :sweat_smile: any help would be appreciated, as always.

Hey Justin,

You can add a counter variable to your list widget like this

<$list filter="[all[tiddler]!is[system]tag[Topic]sort{Topic!!list}]" counter="index"> 

<$transclude></$transclude> ^^<$link to=<<currentTiddler>>>(<<index>>)</$link>^^

</$list>

I’ve assumed your goal is to transclude the topic text - so i’ve also changed this to make sure to close the transclude wigdet tags ( it will default to the currentTiddler and text field).

Remember to use the same filter for the references section so that they are the same list in the same order.

Cheer
CB

1 Like

I didn’t even realize that existed, and it’s perfect! Thank you :grin:

Whoops! typed it so fast I missed a character or two. that was supposed to be a <$transclude/> but I left off a forward slash :sweat_smile:

Yep! i’m gonna need to keep that in mind, I’m curious if the qualify widget will cause any sort of complications, but I imagine not.