[TW5] Reversing the order of a tc-table-of-contents [Resolved]

382 views
Skip to first unread message

Hegart Dmishiv

unread,
Feb 7, 2016, 1:41:58 AM2/7/16
to tiddl...@googlegroups.com
Hi all,

I have implemented a simple blog in my {{DesignWrite}} MOOC course notes TW, and I would like to be able to display the blog entries in reverse date order, so that the most recent post is at the top of the list. I have modified my $:/config/NewJournal/Title so that blog titles all sort automatically based on the time and date they were created. That part all works fine. I've tagged my Blog tiddler as  $:/tags/SideBar  so that it appears in the sidebar, and with some help from the list-before and list-after fields I have it positioned where I want it. I've added the required tc-table-of-contents code to it, as follows....

<div class="tc-table-of-contents">
<
<toc-selective-expandable 'Blog'>>
</div>

What I need to know is how to reverse the order that the blog entries will appear in, when they are listed. I assume the tc-table-of-contents itself is a CSS style hidden somewhere in the underlying TW code. If it is not possible to simply add a parameter somewhere to make the list magically reverse its order, I assume I'd have to create my own copy of the tc-table-of-contents style, modify that, and replace the class= in the code above with my own modified version of the tc-table-of-contents style. Trouble is, I don't even know where the existing tc-table-of-contents style is kept.

Any ideas how to achieve this simply, preferably without having to install any additional plugins?

Hegart.

Scott Simmons (Secret-HQ)

unread,
Feb 7, 2016, 2:24:21 AM2/7/16
to TiddlyWiki
On Sunday, February 7, 2016 at 1:41:58 AM UTC-5, Hegart Dmishiv wrote:

Any ideas how to achieve this simply, preferably without having to install any additional plugins?

Hi, Hegart —

You can pass a "sort" parameter into the TOC macros, so this ought to do the trick:

<<toc-selective-expandable 'Blog' sort:"reverse[]">>

Hegart Dmishiv

unread,
Feb 7, 2016, 2:44:17 AM2/7/16
to TiddlyWiki
Hi Scott,

Perfect! Thanks, that's just what I was hoping for. I can see that now in the TW docs, but I wouldn't have known how to implement it without your example. The complexities of constructing filters, even with those "railway" images on the TW docs, are still a mystery to me.

Hegart.
Reply all
Reply to author
Forward
0 new messages