Creating an Index list using fields.

118 views
Skip to first unread message

Steve Fenner

unread,
Mar 11, 2021, 5:10:37 PM3/11/21
to TiddlyWiki
I'm sorry if this is a repeat, but I did search and couldn't find an answer to this question.

I have been using Tiddlywiki for sometime now but use basically it as a database to store news articles I am interested in, I also create hyper-links to individuals, places, events, etc. named in the articles and have a sort of template I use to save information into separate tiddlers about individuals, places, events, etc.

I want to create an index tiddler that can be in a side tab.  I need to list all the tiddlers that have a field of "tiddlertype" = "Person" or "person"  and then list those tiddlers alphabetically by fields "lastname", "firstname"

This seems like it should be simple to do, but I can't find examples anywhere, although I'd like to learn how to do this simple type of coding I don't really know where to start.  If anyone can suggest to me how to do this (or write the code if its not too difficult), it would be greatly appreciated.  If anyone can suggest the most basic resource for a very beginner for learning to do simple coding in Tiddlywiki it would also be appreciated.  I have been to the tiddlywiki site as well as github and seen examples of code but I just have no idea of how to start to make this work. Sorry to be dense.

Thank-you

Steve

Mark S.

unread,
Mar 11, 2021, 6:49:02 PM3/11/21
to TiddlyWiki
Create a tiddler and give it a caption field with the value "Index". Tag it with $:/tags/SideBar . Put these contents in it:

<$vars mysort="[get[lastname]addsuffix[firstname]]">
<<list-links "[regexp:tiddlertype[(?i)person]sortsub<mysort>]">>
</$vars>

This should do what you have asked, though there is room for improvement.

Steve Fenner

unread,
Mar 12, 2021, 10:29:24 AM3/12/21
to TiddlyWiki
Mark,

Thank-you. Yes, this is want I was trying to accomplish!
Reply all
Reply to author
Forward
0 new messages