Jeremy,
I have thought about this for some time and believe it may be as simple as allowing any child node to be able to provide a list field or filter that overrides the way its children are listed.
The difficulty I have had proposing changes, is the complexity of the current toc macros and perhaps a need for a code refresh, or a new set of toc macros.
For example if the standard toc, before recursively processing the children (tiddlers tagged with the current tiddler), it looked for a “named field” and used this to determine the list of children (if present), it would for example allow the children to be sorted a particular way, list only the children or the current tiddler and return to continue the toc from the level before.
As you suggest it would be even better if a cascade was available such that if;
- A TOC macro Looked to see if the current item provides an alternative filter for its children to be listed (Including the null case) that is the node forces/overrides the method to determine/list its children.
- look to see if a condition existed and used an alternate filter
- Ideally in keeping with your idea of the cascade this would be a cascade either;
- found in one or more nodes or
- applying to all nodes.
To state it clearly
- Allow the TOC to be given a tag used to indicate a cascade that determines the nodes to be listed. One or more of these could look for a custom field in a node to use. Default to the current behaviour.
- Allow the TOC to be given a tag used to indicate a cascade on how to “render each node or link” One or more cascade items could look for a custom field in a node to use. Default to the current behaviour.
This approach would allow almost infinite customisation of the toc.
eg
- List the subtiddlers below a plugin when a plugin is encountered in the toc
- List subtiddler titles like the tree macro using the “/” delimiter.
- Allow a specific node to dictate the filter that defines its children and the template to display/list itself or its children.
- Such a reworked toc should make available a variable such as depth that a filter may used to limit the depth of the TOC - see OT
Regards
Tones