I don’t know if the title exactly describes what I’m trying to do.
- Let me explain better with an example:
Let’s say that with a button I want to select a tiddler that is in the StoryRiver (putting its title in a field of this tiddler/button) And then I want to compare the contents of the field with the titles of the tiddlers in the storyRiver, so that the selected tiddler is highlighted.
Like so:
(I actually don’t really care about this feature, it’s just to give a simple example of the concept I’d like to understand)
Anyway I would proceed this way:
I create the button in the tiddler “Target”
<$button class='tc-btn-invisible'>
<$action-setfield $tiddler="Target" $field="current" $value={{!!title}}/>
{{$:/core/images/close-others-button}}</$button>
Then I edit $:/core/ui/SideBar/Open
and add:
\define HighlightCurrent()
<$list filter="[[target]get[current]] +[!match[{{!!title}}]]" variable="ignore">
<$button class='tc-btn-invisible tc-btn-mini'>
{{$:/core/images/right-arrow}}</$button>
</$list>
\end
And finally I place <<HighlightCurrent>>
just before where the close buttons are defined (so to ideally get a little arrow before the “x” that closes the tiddler i selected with the “Target” button)
Where I defined HighlightCurrent()
I put a filter that unless something is wrong should hide all the “highlight” buttons except the one next to the tiddler which has the same title as the value of the “current” field.
Here the {{!!title}} I believe (this is where I don’t understand) should be the same {{!!title}} which is used by $:/core/ui/SideBar/Open
to to derive the links you see in its output from a $list filter: <$list filter="[list<tv-story-list>]" history=<<tv-history-list>> storyview="pop">
So I thought I could use the same {{!!title}} in another filter at the same time.
But I’m not quite sure how that would work (or if it’s even possible to do something like that).
Could someone explain to me how can an action of this type happen (or if it is possible)?