changes in TOC macros (and/or templating) betwen 5.1.17 and 5.1.19?

63 views
Skip to first unread message

Linda Moss

unread,
May 27, 2019, 9:44:39 PM5/27/19
to TiddlyWiki
Hi!

I just noticed there's been a new version of tiddlywiki out for a while, made a backup, and updated.

My wiki was set up so that every tiddler with a certain tag included a template below the text area that used toc-selective-expandable to automatically show all of that tiddler's children.

However, after updating, the TOC now comes up blank

  • The TOC still works when used directly in a tiddler
  • The ViewTemplate still shows everything else within it just fine
  • The ViewTemplate runs other macros just fine, including ones that pass the title of the current wiki as a parameter.
  • If I have the view template simply print the name of the current tiddler, it prints the correct name

Any ideas what could have caused the TOC macros, specifically, to stop working? The only thing in the release notes that looked related was the fixes they made so that single-quotes in the title would no longer break TOCs. But I doubt that would cause TOCs to stop  working in templates?


(And yes, I verified that the TOC in the template still works fine in the backup I made; the only difference between the two versions is the upgrade to 5.1.19)

Thanks!

~~Linda
Thanks!

TonyM

unread,
May 27, 2019, 10:21:02 PM5/27/19
to TiddlyWiki
Linda,

Perhaps share the code that invokes the TOC from your View Template.

Regards
Tony

Linda Moss

unread,
May 27, 2019, 10:37:21 PM5/27/19
to TiddlyWiki
The template for the bottom tabs section:


\define myBottomTabs(tag:"" tiddler:"")
   
<$list filter="[title[$tiddler$]tag[$tag$]]">
     
<$macrocall
         $name
="tabs"
         tabsList
={{$tag$!!bottom-tabs}}
         
default={{$tag$!!default-tab}}
         state
="$:/.ljm/state/bottom-tabs-state"/>
   
</$list>
\end

\define myBottomTabsTags(tiddler:"")
   <$list filter="[tag[tiddler-types]]">
      <$macrocall $name="myBottomTabs" tag={{!!title}} tiddler="$tiddler$"/
>
   
</$list>
\end

<$macrocall $name="myBottomTabsTags" tiddler={{!!title}}/
>


And the template for the particular tab:


It was originally:

!!! Children

Test: $(current-tiddler)$

<<toc-selective-expandable $(current-tiddler)$>>

But that no longer worked (the bit on the added "Test:" didn't render either.)

So I changed it to:

!!! Children

Test: {{!!title}}

<<toc-selective-expandable {{!!title}}>>

Now the Test: shows the correct title, but I'm still not getting the TOC. (I also tried it with double-quotes around the {{!!title}})

Mark S.

unread,
May 27, 2019, 10:57:40 PM5/27/19
to TiddlyWiki
I don't understand how this line could ever work:

<<toc-selective-expandable $(current-tiddler)$>>

It should have been $(currentTiddler)$ Did you hand type it for this example?

In any event, I suspect that $(currentTiddler)$ won't work either now, because there really was a change to its usage between 5.1.17 and 5.1.19.

Instead, try

<$macrocall $name="toc-selective-expandable" tag={{!!title}}/>


Good luck!

Linda Moss

unread,
May 27, 2019, 11:20:54 PM5/27/19
to TiddlyWiki
Thanks!

Yeah, the "this is how it used to be before I tried to fix it" was an afterthought, and typed in; the rest is copy and paste.

Not sure why I didn't think to call the macro with <$macrocall> (especially since the other macros that did were were custom macros that I was calling with $macrocall).

Cheers,

Linda

TonyM

unread,
May 28, 2019, 12:05:51 AM5/28/19
to TiddlyWiki
Linda,

So this is now fixed ? (by Mark)

$(currentTiddler)$  returns the variables value from where the macr was called. Thus $(currentTiddler)$ is only valid in macros.

eg
\define display() [[here|$(currentTiddler)$]]
<<display>>

Regards
Tony
Reply all
Reply to author
Forward
0 new messages