Make tile image link to a topicref

Questions about XML that are not covered by the other forums should go here.
daryl
Posts: 11
Joined: Thu Feb 11, 2021 9:22 pm

Make tile image link to a topicref

Post 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.
alin
Site Admin
Posts: 270
Joined: Thu Dec 24, 2009 11:21 am

Re: Make tile image link to a topicref

Post 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
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
daryl
Posts: 11
Joined: Thu Feb 11, 2021 9:22 pm

Re: Make tile image link to a topicref

Post by daryl »

thanks! you guys are amazing
Post Reply