Page 1 of 1

Make tile image link to a topicref

Posted: Mon Jun 21, 2021 10:21 pm
by daryl
Hi,

I wanted to insert an image above the links in the tile TOC and followed this guide:

https://www.oxygenxml.com/doc/versions/ ... =topicmeta

The method I chose was editing the ditamap and inserting:

Code: Select all

<topicmeta>
  <data name="wh-tile">
    <data name="image" href="img/tile-image.png" format="png">
     <data name="attr-width" value="64"/>
     <data name="attr-height" value="64"/>
    </data>
  </data>  
</topicmeta>
This worked perfectly - however I would like to make the image clickable and link to the same topicref as the tile title. How can I achieve this?

Thank you so much.

Re: Make tile image link to a topicref

Posted: Tue Jun 22, 2021 4:10 pm
by alin
Hello,

You can achieve this by contributing custom JS code (via an HTML Fragment) to the generated WebHelp HTML pages.
Please have a look at the following sample Publishing Template that provides a similar functionality: https://github.com/oxygenxml/oxygen-pub ... k-on-tiles
This is a sample publishing template that contributes custom JavaScript that registers a 'click' event handler on each tile that opens the associated link.

Regards,
Alin

Re: Make tile image link to a topicref

Posted: Tue Jun 22, 2021 10:05 pm
by daryl
thanks! you guys are amazing