<h1><<toc-caption>></h1><h1><$view field="title"/></h1>\define toc-caption()<$set name="tv-wikilinks" value="no">% <$transclude field="caption"><$view field="title"/></$transclude></$set>\end<$macrocall$name="toc-tabbed-internal-nav"tag="TableOfContents"selectedTiddler="$:/temp/toc/selectedTiddler"unselectedText="<p>Select a topic in the table of contents. Click the arrow to expand a topic.</p>"missingText="<p>Missing tiddler.</p>"/>
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e3fc8dd3-8791-4db0-9860-3ca129fcf26d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If a macro is called in a scope of a tiddler and it calls a macro internally say maymac, then if the maymac is existed in the scope of calling tiddler, it will override the core or other scope macros! Is this kind of overloading?
You said, the toc-caption here will override the one in the core! Can I conclude that:If a macro is called in a scope of a tiddler and it calls a macro internally say maymac, then if the maymac is existed in the scope of calling tiddler, it will override the core or other scope macros! Is this kind of overloading?
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c19bf7dd-d88c-4160-8ce6-1a16b6fffba0%40googlegroups.com.
Thank you to everyone who posted. S.S.'s solution was exactly what I needed. Thanks Jeremy for the explanation, too!
Dave
On Wednesday, February 6, 2019 at 5:43:02 PM UTC-6, David Gifford wrote:Hi allHow would I tweak $:/core/macros/toc (or something else) so that each tab in the toc would show the caption field of the tiddler, but the title within the tab contents would show the longer title field of the tiddler?
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/369b5c20-5a66-4f53-9b8c-7a1cdec58d15%40googlegroups.com.
<$set name="foo" value="John">
<<foo>>
<$set name="foo" value="Paul">
<<foo>>
<$set name="foo" value="George">
<<foo>>
<$set name="foo" value="Ringo">
<$text text=<<foo>>/>
</$set>
</$set>
</$set>
</$set>\define mymacro()<$set name="foo" value="Tony">In macro: <<foo>><br></$set>\end<$set name="foo" value="John">Before Macro: <<foo>><br><<mymacro>>After Macro: <<foo>><br></$set>
<$set name="foo" value="John">Before nested set: <<foo>><br><$set name="foo" value="Tony">In nested set: <<foo>><br></$set>After nested set: <<foo>><br></$set><h1><$text text=<<currentTiddler>>/></h1>
<$transclude mode="block">$missingText$</$transclude>Then when you define your Table if Contents, you do it similar to this:
<$macrocall
$name="toc-tabbed-internal-nav"
tag="TableOfContents"
template="CustomTocTemplate"
selectedTiddler="$:/temp/toc/selectedTiddler"
unselectedText="<p>Select a topic in the table of contents. Click the arrow to expand a topic.</p>"
missingText="<p>Missing tiddler.</p>"
/>
Don't forget to undo the changes you made earlier by simply deleting the edited shadow tiddler : $:/core/macros/toc
Apologies for the earlier not so hot quick fix!
Edited to correct mistaken paste. Changed:
<h1><<toc-caption>></h1>
David,
It was not obvious to me what Tony & Jeremy meant by "using a template parameter" as I was not aware of how it is used!
If you look on the last line on the documentation for Table-of-Contents Macros, it says:
template
Optionally, the title of a tiddler to use as a template for transcluding the selected tiddler into the right-hand panel
So the correct way is to create a template tiddler, say named : CustomTocTemplate
Put the following in that tiddler:
<h1><<toc-caption>></h1>
<$transclude mode="block">$missingText$</$transclude>
Then when you define your Table if Contents, you do it similar to this:
<$macrocall
$name="toc-tabbed-internal-nav"
tag="TableOfContents"
template="CustomTocTemplate"
selectedTiddler="$:/temp/toc/selectedTiddler"
unselectedText="<p>Select a topic in the table of contents. Click the arrow to expand a topic.</p>"
missingText="<p>Missing tiddler.</p>"
/>
Don't forget to undo the changes you made earlier by simply deleting the edited shadow tiddler : $:/core/macros/toc
Apologies for the earlier not so hot quick fix!
Edits were just to clean up the line spacing
<h1><$view field="title"/></h1> not <h1><<toc-caption>></h1>
<h1><$text text=<<currentTiddler>>/></h1>