Sorting sidebar in more Levels

110 views
Skip to first unread message

Gerald Weis

unread,
Aug 14, 2020, 5:25:52 AM8/14/20
to TiddlyWiki

Hallo the spezialists

i have an problem with sorting the sidebar. i want to sort defferents level in different modes.

i admin my cars with tidlywiki.

the cyarname should be sorted in the create field down
the carthings in the caption field up

example:

  • Auto2
    • Benzin
    • Fahrzeugpflege
    • Inspektion und TÜV
    • Räder: Reifen und Felgen
    • Reparaturen
    • Scheibenwischer
    • Versicherung
    • Zulassung
  • Auto1
    • Benzin
    • Fahrzeugpflege
    • Inspektion und TÜV
    • Räder: Reifen und Felgen
    • Reparaturen
    • Scheibenwischer
    • Versicherung
    • Zulassung
  • Hilfe
the sorting works in a tiddler but not in the the sidebar.

i do it so

in tiddler Content
<div class="tc-table-of-contents">
<<toc-selective-expandable "Inhalt"!sort[created]>>
</div>

in tiddler Auto1 and Auto2

<div class="tc-table-of-contents">
<<toc-selective-expandable "Auto1"!sort[caption]>>
</div>

<div class="tc-table-of-contents">
<<toc-selective-expandable "Auto2"!sort[caption]>>
</div>

what can i do that the sorting works in the sidebar.

thanks for help




TW Tones

unread,
Aug 14, 2020, 9:05:24 AM8/14/20
to TiddlyWiki
The syntax you are using seems all wrong

E.g. "Auto2"!sort[caption

The only difference in the sidebar is there is not cureentTiddler value until you or a list create it.

Regards
Tones

Mat

unread,
Aug 15, 2020, 2:43:36 AM8/15/20
to TiddlyWiki
I agree with TW Tones, your syntax is wrong. Should probably be

<<toc-selective-expandable "Inhalt" "!sort[created]">>


It's not sure this solves your actual question tho.

<:-)

Gerald Weis

unread,
Aug 15, 2020, 6:49:28 AM8/15/20
to TiddlyWiki
Hi Mat

that is not solving my Problem.

I want
level 1 of toc Z to A and
level 2 of toc A to Z sorting.

your solution are sorting all in one way

thanks

TW Tones

unread,
Aug 15, 2020, 10:33:31 AM8/15/20
to TiddlyWiki
Gerald,

As you suggest, you wish the second level to be sorted differently to the first, we must also ask what about the third and forth levels?

I do not recall the standard toc macros being designed to handle this. I have posted a number of occasions on recursive macros which a toc macro is. I have also give examples of level type macros that treat each level differently (a few levels only). For example you could call a macro that sorts in one order and for each of the items below call another that sorts in another order, but then perhaps always, sort levels further below that, in one particular way.

I your example you only need to have one list inside another list, and each can have a different sort order. However unlike the TOC macro it will not drill down into deeper and deeper levels.

One though I had it to make an advanced macro that looks to see if there is a sort filter (field) on each tiddler, and sort the children by that if it exists, otherwise use the default sort. In  which case you would need to set this alternative sort order on all tiddlers at the level you want the different sort.

However you could have your top and second level list's nested, then for the children use the TOC macro to go the rest of the way down.

I can give more details to morrow, but see if this helps you understand the issues.

Regards
Tones

Gerald Weis

unread,
Aug 21, 2020, 1:49:37 AM8/21/20
to TiddlyWiki
I solved it with <<tabs

thank for your solutions
Reply all
Reply to author
Forward
0 new messages