In your fieldSelect()
macro, you have a $select
widget, specified like this:
<$select field=selection>...</$select>
Note that the field parameter of the $select widget (i.e., the location where the chosen value is to be stored) is named selection
. However, because no specific target tiddler parameter is provided, the chosen value will be stored in the current tiddler by default.
This works fine in the StoryRiver, because each tiddler displayed there automatically sets the value of <<currentTiddler>>
to match that tiddler’s title.
However… unlike tiddler content rendered in the StoryRiver, tiddler content rendered in the Sidebar has no <<currentTiddler>>
value! Thus, when you choose an item from the $select
widget rendered in the Sidebar, the chosen item value is not stored anywhere.
One possible workaround approach is to add the following line at the beginning of the code in your fieldSelect()
definition:
<$list filter="[<currentTiddler>!match[]else[SidebarSelection]]">
If there is a <currentTiddler>
value (i.e., the value is not blank because the macro is rendered in the StoryRiver) then this line just acts as a pass-thru and leaves the value of <currentTiddler>
as-is. However, if the value of <currentTiddler>
is blank – because the macro is rendered in the Sidebar – then this line will set the currentTiddler
variable to a fallback value of “SidebarSelection”, so that the remainder of the macro code has a valid target tiddler in which to save the selected value.
I hope this explanation helps you sort out what you want to accomplish…
Let me know how it goes.
-e