toc-selective-expandable issue! What is wrong?

96 views
Skip to first unread message

Mohammad

unread,
Aug 6, 2018, 1:57:36 PM8/6/18
to TiddlyWiki
Consider the following example

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

Then Assume you have a tiddler as below
title: Test
tags: myTag
caption: {{!!title}}
some text

Note to the caption, the macro toc-selective-expandable will consider this tiddler caption starts with { while it should wikify the text reference and sort by the result.


Mohammad

TonyM

unread,
Aug 6, 2018, 9:43:59 PM8/6/18
to TiddlyWiki
Mohammad,

Whilst using text references in fields has some value I believe to use them you will need to explicitly wikify or transclude them for results. In the above case your caption is basically saying you have no caption just use the title. Which is the way tiddlywiki tends to behave anyway in a number of places like sidebars and lists. To expect this to occur on demand in the middle of a macro toc-selective-expandable may be over enthusiastic.

If you look into the toc macros provided you may discover how it uses recursion - basically repeatedly calling itself to process each tiddlers tags and the list process falls back to the previous level when the tags run out, ensuring no infinite loop. 

The reason I say this, is I believe you may gain the control you need to address your above requirements if you build your own toc macro equivalent.

On a side note: Working on my edit fields solution I have provided the caption field with a button to populate it with the current tiddler title, which I would expect people to edit for a "shorter" name for lists.

Regards
Tony

Mohammad

unread,
Aug 7, 2018, 3:52:44 AM8/7/18
to TiddlyWiki
Thank you Tony!

/Mohammad
Reply all
Reply to author
Forward
0 new messages