Make tile image link to a topicref

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

Make tile image link to a topicref

Post by daryl » Mon Jun 21, 2021 10:21 pm

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: 205
Joined: Thu Dec 24, 2009 11:21 am

Re: Make tile image link to a topicref

Post by alin » Tue Jun 22, 2021 4:10 pm

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: 12
Joined: Thu Feb 11, 2021 9:22 pm

Re: Make tile image link to a topicref

Post by daryl » Tue Jun 22, 2021 10:05 pm

thanks! you guys are amazing

Post Reply