User Tools

Site Tools


samana:johann:makrosolu

Linking Image A ⇒ Image B

Solution via Textinsert Plugin (Makro)

(Proof of concept)

The Task

Linking of two different images in the current namespace (that means: namespace relative)

The Demonstration

Please klick on the small picture.


sao_small.jpg


The wiki code

#@li2i_HTML~sao_small.jpg,sao.jpg~@#

The macro definition

  li2i_HTML   <a href="/lib/exe/fetch.php?media=#@NS@#:%2" class="media" title="#@NS@#:%2"><img src="/lib/exe/fetch.php?media=#@NS@#:%1" class="mediacenter" title="%1" alt="%1"></a>

The name of the makro  li2i  stands for “Link Image To Image”. The appendix  _HTML  is a requirement of the plugin for generating HTML code.

Limitations

  • This macro links only two images that belong to the current namespace. (References beneath the current namespace should also be possible. But not tested yet.)
  • There are no formatting options. (You can do this by CSS or by changing the makro code.)
  • Maybe it works only with JPG-images (I have seen that PNG-files are linked by DokuWiki in another way.)
samana/johann/makrosolu.txt · Last modified: 2019/06/22 08:24 by michaelsy