diff --git a/core/wiki/macros/image-picker.tid b/core/wiki/macros/image-picker.tid index 9b1fcfa87..68bbba34d 100644 --- a/core/wiki/macros/image-picker.tid +++ b/core/wiki/macros/image-picker.tid @@ -11,10 +11,10 @@ $actions$ \end -\define image-picker(actions) +\define image-picker(actions,subfilter:"")
-<$list filter="[all[shadows+tiddlers]is[image]!has[draft.of]] -[type[application/pdf]] +[sort[title]]" variable="imageTitle"> +<$list filter="[all[shadows+tiddlers]is[image]$subfilter$!has[draft.of]] -[type[application/pdf]] +[sort[title]]" variable="imageTitle"> <$macrocall $name="image-picker-inner" actions="""$actions$"""/> diff --git a/editions/tw5.com/tiddlers/macros/examples/colour-picker_Macro_(Examples).tid b/editions/tw5.com/tiddlers/macros/examples/colour-picker_Macro_(Examples).tid index 8b8e1c79a..47c211a47 100644 --- a/editions/tw5.com/tiddlers/macros/examples/colour-picker_Macro_(Examples).tid +++ b/editions/tw5.com/tiddlers/macros/examples/colour-picker_Macro_(Examples).tid @@ -1,6 +1,6 @@ created: 20160418152735536 modified: 20160418155324847 -tags: [[changecount Macro]] [[Macro Examples]] +tags: [[colour-picker Macro]] [[Macro Examples]] title: colour-picker Macro (Examples) type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/macros/examples/image-picker_Macro_(Example_2).tid b/editions/tw5.com/tiddlers/macros/examples/image-picker_Macro_(Example_2).tid new file mode 100644 index 000000000..f05b320d5 --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/examples/image-picker_Macro_(Example_2).tid @@ -0,0 +1,17 @@ +created: 20160418155523369 +modified: 20160418155913663 +tags: +title: image-picker Macro (Example 2) +type: text/vnd.tiddlywiki + +Image: <$edit-text tiddler='$:/_MyImage' tag='input' placeholder='(unset)' default=''/> + +<$transclude tiddler={{$:/_MyImage}}/> + +--- + +<$macrocall $name='image-picker' actions=" + +<$action-setfield $tiddler='$:/_MyImage' $value=<>/> + +" subfilter="prefix[Language]"/> diff --git a/editions/tw5.com/tiddlers/macros/examples/image-picker_Macro_(Examples).tid b/editions/tw5.com/tiddlers/macros/examples/image-picker_Macro_(Examples).tid index 5bc282ccb..1af13f48a 100644 --- a/editions/tw5.com/tiddlers/macros/examples/image-picker_Macro_(Examples).tid +++ b/editions/tw5.com/tiddlers/macros/examples/image-picker_Macro_(Examples).tid @@ -1,7 +1,11 @@ created: 20160418155539132 modified: 20160418155621890 -tags: [[changecount Macro]] [[Macro Examples]] +tags: [[image-picker Macro]] [[Macro Examples]] title: image-picker Macro (Examples) type: text/vnd.tiddlywiki <$macrocall $name=".example" n="1" eg={{image-picker Macro (Example 1)}}/> + +This next example shows how the <<.param subfilter>> parameter limits the list of images (here to those with the "Language" prefix): + +<$macrocall $name=".example" n="2" eg="{{image-picker Macro (Example 2)}}/> diff --git a/editions/tw5.com/tiddlers/macros/image-picker_Macro.tid b/editions/tw5.com/tiddlers/macros/image-picker_Macro.tid index cf04cee22..d6e2d38dd 100644 --- a/editions/tw5.com/tiddlers/macros/image-picker_Macro.tid +++ b/editions/tw5.com/tiddlers/macros/image-picker_Macro.tid @@ -1,4 +1,4 @@ -caption: colour-picker +caption: image-picker created: 20160418155531395 modified: 20160418155805435 tags: Macros [[Core Macros]] @@ -11,5 +11,11 @@ The <<.def image-picker>> [[macro|Macros]] displays an interactive image picker, ;actions : Wikitext for the action widgets that should be executed when the user selects an image. Within the text, the variable `imageTitle` contains the title of the tiddler containing the selected image. +;subfilter +: An optional extra [[filter step|Filter Step]], e.g. `tag[MyTag]` + +The images are selected by means of a [[filter expression|Filter Expression]], into which the <<.param subfilter>> parameter is spliced as follows: + +> `[all[shadows+tiddlers]is[image]$subfilter$!has[draft.of]] -[type[application/pdf]] +[sort[title]]` <<.macro-examples "image-picker">>