Why does this action only work on non-shadow tiddlers?

I’m working on a navigation system very similar to Scott_Sauyet’s Wizard Nav.
However, I’m having problems with either a filter or with an $action-setfield: I would like, when going from one tiddler to another during navigation, that the name of the “path/tag” being navigated should be set as the value of a field, so to be shown as the current “path/tag” once we arrive in the next tiddler (in case there are more paths, the “right” one is already selected).

Problem is, this $action-setfield seems to work only on non-shadow tiddlers, and I can’t figure out why:
I think the problem is either this filter:

<$set name="X" filter="[all[current]get[current-path]] :else[is[current]tags[]prefix[/]sort[title]first[]]">

or this $action-setfield:

<$action-setfield $tiddler=<<currentTiddler>> $field="current-path" $value=<<X>> $timestamp="no"/>

I think there is an operator or operand somewhere that excludes shadow tiddlers.

Tell me if you need more information

Oh, that’s a brilliant idea! That would clear up the biggest problem I have with WizardNav.

I’m afraid I have no insight into the problem you’re encountering. Good luck with it!

But I eagerly await the solution; and I hope you make the whole thing public.

1 Like

Sure!
As soon as the code works and is cleaner I will definitely share it

Thank you!

To help solve this, could to state what you think the filter in your set statement is doing in plane English?

  • Do you want X, and subsequently current-path, to equal to the value of the field current-path, else the first tag starting with a / ?
    • And what if neither were true?
1 Like

Correct interpretation, it should do exactly what you said

I did not think about that :sweat_smile:. But it shouldn’t be a problem, because there is a $list with the same filter next and nothing is displayed if neither condition is true. Not sure now if it is really not a problem… :joy:

Anyway, as soon I am on my personal computer I’ll share the code, so if needed things should be clearer. (Even if for now not all things work yet)

:warning: For anyone reading, remember that the credits belong to @Scott_Sauyet, as this is just a change to one of his plugins (if you see in my code that I changed object names and there aren’t many references to the original plugin anymore I did that to be consistent with the rest of my wiki, I didn’t plan to share the code until I completed it)


I’ll explain the differences in words so I’ll save you from interpreting the code.
The first thing you can notice that differs from the Nav Wizard is that I’ve changed the filter that regulates which tags can become “navigation paths”.
In Wizard Nav it was a Tag Tiddler that itself is tagged “Wizard” (or a different configurable name), I love prefixes (sooner or later I’ll write: In praise of prefixes) and so the tags that have a prefix “/” are the navigable tags in my version.

There are two buttons next to the tag-pill, a milestone [1] and a sign [2] which will later contain two popups. (undefined for now)

Next to the “milestone” button there is a number that is the position of the current tiddler in the path (in the example the tiddler is the second tiddler of a total of three you can see the total number of tiddlers tagged with “/path1” thanks to the plugin tag-count by benwebber)
Next to the “sign” button the number should show the number of different paths in the current tiddler… (I still have to fix it) This button if clicked will have a dropdown where “at the crossroad” you can select witch path to follow, setting as the value of the field “current-path” the name of the path you selected.

When you go from the current tiddler to “New-A”, the button styled like a link will also set to the “current-path” field of the tiddler “New-A” either the first tag with prefix [/] in alphabetical order if no “current-path” is defined in the starting tiddler, or the same value of the “current-path” field of the starting tiddler (if there is one).

  • Here the problem I described in the first post: if the tiddler to witch I’m navigating to was “$:/New-C” and not “New A” (a shadow tiddler), its “current-path” is not updated.

Tiddlers:

• Viewtemplate
$ rga_imp-_Ui_ViewTemplate_Percorsi(3).json|attachment (2.3 KB)

• Example tiddler in the same “path”
New-A(1).json (45 Bytes)
$ _New-C.json (48 Bytes)

• Icons:
$ _img.percorsi.json (686 Bytes)
$ _img.tappa.json (580 Bytes)

• Stylesheet:
$ rga_imp-_Ui_ViewTemplate_Percorsi(2).json|attachment (2.4 KB)


There would be other tiddlers to share, but they are not important now. (Nothing special)
(like an edited version of $:/core/ui/TagTemplate and a $:/config/EditTemplateFields/Visibility/ to hide the “current-path” field which shouldn’t be visible)
But I’ll illustrate the rest when I’m done

3 Likes