I am using the core image picker macro to create a custom image picker.
Here I am using a html table within this custom template.
In the bottom part of the table , I am transcluding the custom image picker macro.
In the top part, the image selected using the image picker macro will be shown using field transclusion.
Images are shown in single column or two column depending upon the use of a modifier variable. This use of modifier variable is not working. What is wrong with that part of the code. I have used modifier variable similarly in some other contexts which are working.
Didnât see the Modifier variable defined in your script, though there are two references to the variable. Is it defined somewhere with the value ânormalâ or âaltâ ?
The âModifierâ variable is referred to within that two filters. It has to be defined first before it can be referred to.
If the value of the Modifier variable comes from an text input field or a selector field somewhere, then maybe use the field reference {tiddler_name!!text-input-field} or {tiddler_name!!selector-field} instead of variable (i.e. <modifier>) within the filter. You might want to refer back to your other usages of modifier variable to see how it was defined. There is probably a <$let modifier=...> somewhere. Find out how and where the modifier variable get itâs ânormalâ or âaltâ value ?
The modifier variable is set by the TWCore when processing actions triggered by various interactive widgets (see https://tiddlywiki.com/#modifier%20Variable). As of v5.2.0, this variable is also set for actions triggered by the $keyboard widget.
The difference is that the actions are processed by the $button widgetâs actions parameter rather than using an âinlineâ $transclude widget within the body of the $button widget.
The reason this may work is because of the following TWCore code in the $:/core/modules/widgets/button.js handler:
if(self.actions) {
var modifierKey = $tw.keyboardManager.getEventModifierKeyDescriptor(event);
self.invokeActionString(self.actions,self,event,{modifier: modifierKey});
}
which handles execution of the $button widgetâs actions=... parameter, as compared with
which handles execution of âinlineâ actions within the content of the $button widget. Note how the actions=... handling explicitly gets and passes the modifierKey value, while the handling for the âinlineâ actions does not.