<$set name="limit" value="6">
<table style="width:80%">
<tr>
<$list filter="[all[shadows]tag[$:/tags/Image]limit<limit>]">
<td>
<$set name="image" value=<<currentTiddler>>>
<$list filter="[<image>removeprefix[$:/core/images/]]">
<span class="doc-button">
<$transclude tiddler=<<image>>/> <br><<currentTiddler>>
</span>
</$list>
</$set>
</td>
</$list>
</tr>
</table>
</$set>
<$count filter="[all[shadows]tag[$:/tags/Image]]"/>
<div class="dynamic-table">
<$list filter="[all[shadows]tag[$:/tags/Image]]">
<$set name="image" value=<<currentTiddler>>>
<$list filter="[<image>removeprefix[$:/core/images/]]">
<span class="doc-button item">
<$transclude tiddler=<<image>>/><br><<currentTiddler>>
</span>
</$list>
</$set>
</$list>
</div>
<style>
.dynamic-table {
max-width:80%; /* could transclude tiddler width instead */
-ms-box-orient: vertical; /* might be unnecessary */
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -moz-flex;
display: -webkit-flex;
display: inline-flex;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
flex-direction: row;
}
.item {
max-width:210px; min-width:210px; /* adjust this to give space to longer worded items */
flex: 0 0 2em; /* -grow, -shrink, -basis */
}
</style>
\define edit-fields-image-picker(actions,filter:"[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]",subfilter:"") <div class="tc-image-chooser"> <$vars state-system=<<qualify "$:/state/editFields-image-picker">>> <$checkbox tiddler=<<state-system>> field="text" checked="show" unchecked="hide" default="hide"> Select Image</$checkbox> <$reveal state=<<state-system>> type="nomatch" text="hide" default="hide" tag="div"><$macrocall $name="image-picker-list" filter="""$filter$""" actions="""$actions$"""/></$reveal> </$vars> </div> \end
<$macrocall $name='edit-fields-image-picker' actions="<$action-setfield $field='icon' $value=<<imageTitle>>/>"/>
<div class="dynamic-table">
<$list filter="[all[shadows]tag[$:/tags/Image]]">
<$set name="image" value=<<currentTiddler>>>
<$list filter="[<image>
removeprefix[$:/core/images/]]">
<$button message="tm-copy-to-clipboard" param=<<currentTiddler>>tooltip=<<currentTiddler>> class="tc-btn-invisible" >
<$transclude tiddler=<<image>>/>
</$button>
</$list>
</$set>
</$list>
</div>
.doc-images-large svg { height: 2em; vertical-align: text-bottom; }
Here is an Image Picker macro
RegardsTony
Tony
\define link-to-clipboard(parameter) <<.button-images $(currentTiddler)$>>
<div class="dynamic-table doc-buttons">
<$list filter="[all[shadows]tag[$:/tags/Image]]">
<$set name="image" value=<<currentTiddler>>>
<$list filter="[<image>removeprefix[$:/core/images/]]">
<$button message="tm-copy-to-clipboard" param=<<link-to-clipboard>> tooltip=<<currentTiddler>> class="tc-btn-invisible">
<$transclude tiddler=<<image>>/>
</$button>
</$list>
</$set>
</$list>
</div>
<style>
.dynamic-table {
max-width:80%; /* could transclude tiddler width instead */
-ms-box-orient: vertical; /* might be unnecessary */
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -moz-flex;
display: -webkit-flex;
display: inline-flex;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
flex-direction: row;
}
.item {
max-width:210px; min-width:210px; /* adjust this to give space to longer worded items */
flex: 0 0 2em; /* -grow, -shrink, -basis */
}
.doc-buttons button {
font-size: 1.3em;
padding: 0.3em 0.3em;
}
</style>
Put this in a tiddler:
System images (ie, tiddlers tagged [[$:/tags/Image]]):
<style>
.my-gallery svg {
width: 1.5em;
height: 1.5em;
margin: 1em;
}
</style>
<div class="my-gallery">
<$list filter="[all[tiddlers+shadows]tag[$:/tags/Image]sort[]]">
<$link tooltip="{{!!title}}">
<$transclude/>
</$link>
</$list>
</div>
Cheers,
Thomas