Dear all, here's upgrade-troubleshooting post #3, with apologies if I failed to find an existing answer...
The power of transcluded template tiddlers is enormous, and yet I'm frustrated by what happens when any tiddler that *uses* such a template is then itself shown within another tiddler (say, in a tab, or a table of contents structure). For example...
I have a simple {{childtabs}} template, plus a {{childtabs-vert}} variant, and one of these is transcluded at the bottom of most of my significant tiddlers (replacing old ForEachTiddler function). It just presents a tab for each "child" (= each tiddler tagged with the current tiddler's title). I love how quick it is to pop that string into place; I also love that tweaking the template makes the changes reverberate through all the instances. Here's the current contents of that template:
<$set name="target" filter="[<storyTiddler>get[draft.of]] [<storyTiddler>!has[draft.of]]">
<<tabs "[tag<target>]" {{!!title}} "$:/state/tabby">>
</$set>
What I really wish for is a variant that resolves "within" the lowest-level tiddler in which it's most directly embedded. So, when I'm currently reading a "grandparent"-level tiddler (like
units), each child-tab (including, say,
Unit A) should ideally render just as it would if it were called up on its own, meaning it would show tabs for its own children (like
Epictetus), which then may have further children, etc. (using a mix of horizontal and vertical tabs makes this surprisingly not too visually noisy).
But as it is, trying to drill down (when the {{childtabs}} and {{childtabs-vert}} templates are in use) shows either a tab set that simply replicates the enclosing set, or a recursive transclusion error — which I especially want to avoid in a teaching resource site! (Meanwhile, other transclusions I'm using end up just showing nothing at all when the tiddler they're part of is being rendered as a tab within a tiddler that doesn't have the relevant fields.)
I realize I could explicitly spell out the rigid local tiddler title, "baking in" each use of a template, but that seems to undermine the power and simplicity of templates. Have others also wished for a tighter kind of transclusion that clings to the narrowest enclosing context...? Is it possible? Am I missing something obvious?
-Springer