Need A Bit Of Help With Sorting

Hey guys I got a question and need help ASAP.

I have a basic understanding of how TABS and MACROS work. Here is a basic break down on what I want done.

Below is a picture of how my TiddlyWiki looks at the present moment.

image

Now I got the basic structure of where my tabs are and that’s all well and good.

Now I would like to sort the TOC within each tab as an expandable tree type of list. This is where it get’s confusing for me as I got minimal programming experience.

Below is the Macro I used for the basic tab sorting…

From what I can tell, this sort is using the Title as the sort order. Meaning it’s an alphabetical order (A-Z) of all the tiddlers in this tab.

Now my request: I would like to instead use an expandable tree like ordering where my sub-tiddlers could be nested within the tab. Like for instance:

  • Dungeon’s & Dragons
    • Characters
    • Locations
    • Chapters
  • Hazbin Hotel
    • Short Stories
    • Chapters
    • Sean’s Journal

And so on.

Please Note that I’m not a programmer and it’s hard for me to grasp how Macros work in general. So any information that I can reference would be greatly appreciated.

Hi Sean,

To get this, first you need to tag your Tiddles.

Tag with Dungeon’s & Dragons your tiddles Character, Locations and Chapters
Tag With Hazbin Hotel your tiddles Short Stories, Chapters and Sean’s Journal

Now you need to delete sort[Title] on your Macro.

To specify the order you want for your tiddles you need to use the field list. To add a field you just need to type list in the bottom of your tiddle, like this:

image

You need to create the list field inside the Dungeon’s & Dragons tiddle, now you type the order of tiddles you want.

Do the same with the Hazbin Hotel tiddle.

If the tiddle have more than one word in the title, you need to put it inside the [[ ]].

The macro will order your tittles based in the list field

Okay. Makes sense.

Okay, I may have issues so I’ll set up another wiki to try things out before I do it on a live wiki.

That’s what the toc-selective-expandable macro is designed for.

For Dungeons and Dragons to appear on the My Writings menu, it must be tagged My Writings. For Characters to appear in the Dungeons and Dragons submenu, it must be tagged Dungeons and Dragons. And so on. But a caution, you’ll need distinct titles. You have two different Chapters tiddlers on your list. I would suggest making a more unique name, for instance, DnD Chapters and HH Chapter. Both can have a caption field with the value Chapters, so that’s what will show up in most places.

It’s easy to add a new item tagged with the title of the current tiddler: use the new here link in the more menu from the tiddlers top-right control bar:

As @Hildebrando_Pereira said, if you want more control over the sorting, and can’t use just an alphabetic sort at each level, then you can updated the list field. You can do it manually as he suggested, but perhaps easier is to click on, say, the Dungeons & Dragons tag pill to see its children, and drag-and-drop them to reorder the list. That new order will show up in the TOC and various other places.

This demo shows what I mean: writings.json (1.6 KB). Download it and drag it onto a wiki (an empty one or TW.com; not your current one, as it might well override things you wouldn’t appreciate.) You should see a new “Writings” sidebar tab. Expand the Dungeons & Dragons menu, and open its Chapters link. (You’ll notice that the actual title is DnD: Chapters, but the caption is just Chapters).

That will have a tag pill for “Dungeons and Dragons”. Click on that and drag the three children around. You’ll see the menu update in real time.

Can you also use the Tag Manager to do that as well?

Also can you guys give me a step by step instructions. Like I said, I only got basic understanding TiddlyWiki.

No, that is for setting colors and icons for tags.

It was easier to record a video than to type it all up. You can see it at http://scott.sauyet.com/Tiddlywiki/Demo/MyWritings.gif.

There is one thing I forgot to turn off in my own personal starter edition that you might want to include as well: the showing of captions in place of titles in the tiddler header. You can include that by downloading the following file and dragging it onto that wiki: ShowCaptionsAsTitle.json (348 Bytes). With that, you should be able to do similar steps to what I did.

Thanks guys very helpful. I hope to show you guys my site when I’m done. :grinning: :laughing:

EDIT:

Okay after a bit of snooping around on Wikilabs (https://wikilabs.github.io/) I found a plugin called tocP (tocP — Parent based - Table of Content). It an interesting read. It’s similar to the macro based TOC macros but it’s easer on the resource requirements and it’s a “soft” macro version to the traditional macro.