@arunnbabu81 If you’re willing to replace all your instances of [img[...]]
with a macrocall or a template transclusion, @TW_Tones’s approach would definitely be quickest, and you don’t need 5.3.0 functionality to do it. Here’s a super-quick mockup you can test at tiddlywiki.com:
\define img(source)
<$list filter="[[$:/config/image-mode]text[popup]]"
emptyMessage="""<$image source=<<__source__>> />""">
<$button popup=<<qualify "$:/state/$source$">>>
Pop me up
</$button>
<$reveal type="popup" state=<<qualify "$:/state/$source$">>>
<div class="tc-drop-down">
<$image source=<<__source__>> />
</div>
</$reveal>
</$list>
\end
\define mode()
<$action-listops $tiddler="$:/config/image-mode" $field="text" $subfilter="+[toggle[popup]]" />
\end
<<img "Motovun Jack.jpg">>
<$button actions=<<mode>>>image mode</$button>
I used a macro mostly for the single-tiddler demonstration, but you could just as easily make the img
macro a template tiddler and call it with {{Motovun Jack.jpg||img}}
. I didn’t do any particular styling on the popup, but you could style it to your liking (or use a modal instead) and add additional macro parameters for other $image
attributes.
You’d want to move the “image mode” button and the mode
macro definition to a separate tiddler for your view toolbar button. The sample button is currently toggling a global config tiddler, but you could alter it to modify <<currentTiddler>>
instead, if you want per-tiddler control.
If you do want to go this route, I’d recommend using the Commander plugin to search-and-replace the wikitext in all the tiddlers where you want this alternate behavior.