Topicref with external target doesn't open in new browser tab

Post here questions and problems related to editing and publishing DITA content.
rjcbop
Posts: 56
Joined: Wed Aug 08, 2018 10:23 pm

Topicref with external target doesn't open in new browser tab

Post by rjcbop »

We're generating webhelp responsive output and want a TOC item that links to a PDF which will then open in a new browser tab. We tried a topicref element, setting the target to the URL for the PDF (the PDF is hosted on an external server). Although the scope of the topicref is set to external, the PDF opens in the same tab as the webhelp responsive output.

For example, we have something like the following topicref in our map:

<topicref href="URL to our PDF" format="pdf" scope="external" navtitle="Link to a PDF"/>

We did notice that if we use an xref for the PDF, and set the scope to external, then the PDF opens in a separate tab, since in that case the generated HTML has the target="_blank" setting. However, we'd like to avoid creating a topic that contains only a link to a PDF.

Is there a way to achieve what we're trying to accomplish?
Costin
Posts: 828
Joined: Mon Dec 05, 2011 6:04 pm

Re: Topicref with external target doesn't open in new browser tab

Post by Costin »

Hello,

We tested this behavior but we could not reproduce the reported issue - the PDF resource opens in its own separate tab, both when it is referred by the topicref element through xref and through href.
This is also the default behavior in the latest version of oXygen.

What specific version of oXygen are you using? It could have been an issue with opening external resources in a new tab that affected old versions of oXygen, but this no longer occurs with newer versions.
Also, is your WebHelp output local, on your machine, or is it stored on a web server?

In case you can still reproduce the issue even if you use the latest version available on our website, you should send us (support@oxygenxml.com) a sample DITA Map in an as minimal form as possible, that you could use to reproduce the issue, so we could take a look at it and see what goes wrong.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
rjcbop
Posts: 56
Joined: Wed Aug 08, 2018 10:23 pm

Re: Topicref with external target doesn't open in new browser tab

Post by rjcbop »

Thanks for testing it out so quickly. I've isolated the issue to the case where the topicref that links to the PDF is nested under a topic (or topichead). The link on the main page of the help works fine (opens up in a separate tab), but if you drill down into the topic that contains the child PDF topicref (see image below), the link in the left-hand TOC doesn't open up in a separate tab.
pdf_link.png
pdf_link.png (10.45 KiB) Viewed 1970 times
For reference, we're using build 2019022122 of the DITA-OT, that's bundled with oXygen 21.0. And the WebHelp output is on my local machine. And here's a trivial sample map:

<map id="m_test">
<title>Test map</title>
<topicref href="c_test_parent_topic.dita">
<topicref href="URL to PDF" format="pdf" scope="external" navtitle="PDF link"/>
</topicref>
</map>

Thanks!
ionela
Posts: 400
Joined: Mon Dec 05, 2011 6:08 pm

Re: Topicref with external target doesn't open in new browser tab

Post by ionela »

Hi,

Thank you for all these details.
We've managed to reproduce the problem on our side and I have logged it to our issue tracking tool. This will be further analyzed by our development team.
We'll update the thread when the bugfix becomes available.

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
cosmin_andrei
Posts: 135
Joined: Mon Jun 12, 2017 10:50 am

Re: Topicref with external target doesn't open in new browser tab

Post by cosmin_andrei »

Hi,
I just wanted to let you know that this issue is fixed now, and the fix is available in the latest version of Oxygen, version 25.1 which we released last week.
https://www.oxygenxml.com/download.html

Please let us know if you encounter further problems with this new version.
Regards,
Cosmin
--
Cosmin Andrei
oXygen XML Editor and Author Support
rjcbop
Posts: 56
Joined: Wed Aug 08, 2018 10:23 pm

Re: Topicref with external target doesn't open in new browser tab

Post by rjcbop »

Thank you!
Post Reply