On Apr 9, 9:02 pm, Eric Shulman <[email protected]> wrote:
> > <span class='sectionTOC small'><b>Table of Contents:</b></span>
> > <!--to actually display table of contents add <<sectionTOC>> at the
> > end of a tiddler-->
>
> > It works as intended except the "Table of Contents:" text is of course
> > in every tiddler now. How can I hide it if <<sectionTOC>> is not
> > present in an actual tiddler?
>
> Get the latest update (v1.1.1)
> http://www.TiddlyTools.com/#SectionLinksPlugin
>
> Then, in your ViewTemplate, write:
>
> <span class='sectionTOC small' style='display:none'>
> <b>Table of Contents:</b>
> </span>
>
> This will *hide* the sectionTOC 'target element' by default, and only
> show it when the <<sectionTOC>> macro is actually in a tiddler.
I actually have the opposite use case. I include the:
<span macro="sectionTOC"></span>
in a template after the:
<div class='viewer' macro='view text wikified'></div>
so that sectionTOC is at the end of the tiddler to catch all the
headings in the tiddler.
I would like the sectionTOC macro to only gather the headers and not
display any text
unless there is a {{sectionTOC{}}} (or associated class) in the
tiddler.
This way I can put the toc where I want in the tiddler text.
Right now all of my tiddlers have a TOC at the end due to the
placement of the
sectionTOC macro in the template.
Any ideas on a solution to this? I tried changing the current
sectionTOC macro into sectionTOCs
(sectionTOC silent) by modifying the last line of the macro from:
wikify(out.join("\n"),target||place);
to
if (target) wikify(out.join("\n"),target);
and using sectionTOCs in my template, but to my surprise I am still
getting the trailing TOC.
-- rouilj
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---