Two questions about TiddlyWiki 5 haunting me

142 views
Skip to first unread message

Chlorine Tan

unread,
Jan 6, 2016, 10:56:01 PM1/6/16
to tiddl...@googlegroups.com
Hello everyone,

I was a TiddlyWiki Classic user and just moved to TiddlyWiki 5 not long ago.
It seems to me that two functions applicable to the classic one fails in 5.

1. Is there a way to arrange the orders of the tags displayed at the beginning of each tiddler?
2. Is there a way to modify the style of each cell in a table, e.g. its background color?

I will be grateful for any help you can provide.

Best wishes

Chlorine Tan

Jed Carty

unread,
Jan 7, 2016, 2:54:12 AM1/7/16
to TiddlyWiki
Unfortunately tags are ordered alphabetically every time the wiki loads so there isn't any way to change their ordering.
For tables, if you want to style individual cells you would need to use html tables. In TW5 you can use list widgets and macros to automatically build the table rows and set the appropriate cell styles in many cases.

cmari

unread,
Jan 7, 2016, 1:14:15 PM1/7/16
to TiddlyWiki
For your first question: The $:/core/ui/ViewTemplate/tags shadow tiddler specifies that tags should be sorted by title (sort[title]), but you could change that to something else (e.g., a field value). Or, here's a method for just changing the order of a particular subset of tags:

1. Create tiddlers for the tags that you'd like to have appear in a certain order, e.g., 
Jan
Feb
Mar
etc.

2. In each tiddler:
a) Add a field with the desired sort order for that tag:
In the Jan tiddler: field=tagorder value=1
In the Feb tiddler: field=tagorder value=2

b) The above would be enough because you could filter for 
has[tagorder] 
but I found it helpful to also give the entire group a unique tag color, so I also added a color field to each tiddler:
field=color value=#977ef8

3. Use Advanced Search to find the shadow tiddler $:/core/ui/ViewTemplate/tags
Here's where you can decide how you want things to sort. My preference was to edit the original filter so that it excludes tags with my unique color, and then add a second filter finding and sorting only the tags with my color. 
I replaced the text between <div class="tc-tags-wrapper"> and </div> with:

<$list filter="[all[current]tags[]-field:color[##977ef8]sort[title]]" template="$:/core/ui/TagTemplate" storyview="pop"/><$list filter="[all[current]tags[]field:color[##977ef8]sort[tagorder]]" template="$:/core/ui/TagTemplate" storyview="pop"/>

Note that (unless you also change $:/core/ui/EditTemplate/tags, you will not see the effect of this when editing a tiddler. The sorting will only happen in View mode.
cmari
Reply all
Reply to author
Forward
0 new messages