All[current]tagging[] doesn't work in a macrocall (in sidebar tab)

I have created a tiddler $:/fdz/ui/SideBar/ProjetX_Tab that correctly displays a new navigation tab thanks to the $:/tags/SideBar tag. The content is:

<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/fdz/ui/SideBar/ProjetX_Tab]!has[draft.of]]"

I tried to make it more generic by removing the reference to itself:

<$macrocall $name="tabs" tabsList="[all[current]tagging[]!has[draft.of]]"

It didn’t worked, so I tried:

<$macrocall $name="tabs" tabsList="[<thisTiddler>tagging[]!has[draft.of]]"

Didn’t work either…

And why [all[current]] does exist when the logical form should be [<currentTiddler>]?

I’m a one question at a time kind of guy, so…

I’m thinking [all[current]] is notation that existed before [<currentTiddler>] became an available option.

For backwards compatibility, [all[current]] remains. For some, that may still be the preferred choice for readability, or simply because it is less prone to typos. Or, name any other reasoning here.

“Logical form” is in the eye of the beholder ?

Have a closer look at: https://tiddlywiki.com/#tabs%20Macro – near the end.

Did you try “currentTab” instead of “currentTiddler”. – I did not test any code. Just remembering a reference in the docs

1 Like

It’s a bit convoluted, but here’s the situation:

currentTiddler is only defined when the wikitext is displayed within the StoryRiver. Thus, because you are rendering your project tab within the Sidebar, references to currentTiddler won’t work there.

thisTiddler IS defined for content that appears in the sidebar, BUT… when passed to the <<tabs>> macro as part of the tabsList parameter, the value of thisTiddler is unavailable when rendering the tab buttons.

Fortunately, there is another variable that is defined within the <<tabs>> macro itself when rendering a set of tabs: currentTab

Thus, this should work as you intend:

<$macrocall $name="tabs" tabsList="[<currentTab>tagging[]!has[draft.of]]"/>
3 Likes

As noted by @Charlie_Veniot, [all[current]] is older filter syntax that was around before <currentTiddler> was available within filters. Note that while <currentTiddler> is slightly more efficient that [all[current]], the older syntax still exists to support backward-compatibility for filters that were written a long time ago.

In addition, there may be some cases where it is useful for the parameter of the [all[...]] filter is to be determined by a variable that has been set outside of the filter syntax. Thus, you can write [all<somevar>], where somevar could be set to “current” or “tiddlers” or “shadows” or “shadows+tiddlers”, etc. to control the scope of tiddlers the filter operates on.

-e

4 Likes

Don’t you think that [all[current]] is a kind of oxymore?

Nah. I don’t think in those terms because then I’m criticizing a choice that was made and I’m criticizing the person who made that choice. If I can’t place myself in their shoes and the circumstances of that time, I prefer to not be in the business of making any kind of judgement because if I think that way, I feel miserable. So I don’t think that way, and find myself way happier.

I strive to not have negative thoughts, and to asap quash any negative thoughts, because they poison the pursuit of joyful being.

There are often things that today may seem nonsensical, but they made perfect sense in a time and place, and the things continue to exist for the benefit of compatibility.

I rationalize: [all[current]] as “of all the tiddlers, I only want the current one”, and I think that’s A-1.

3 Likes