Page 1 of 1

WebHelp ditamap external scope link

Posted: Sun Aug 10, 2014 5:39 am
by scotmarvin
I'm using some links in the TOC that are external to the DITA project. I was hoping that the ditamap would treat these links as dita files do: open in a new window. However, even thought the links have attributes scope=external and format=html, the links are generated in the WebHelp content pane, not in a new window.

Here's the code in question:

Code: Select all


<topicref navtitle="Documentation Archive"
href="https://www.eucalyptus.com/eucalyptus-cloud/documentation/archive" scope="external"
format="html">
<topicref href="https://www.eucalyptus.com/docs/eucalyptus/4.0/index.html" scope="external"
format="html" navtitle="4.0.0"/>
<topicref href="https://www.eucalyptus.com/docs/eucalyptus/3.4/index.html" scope="external"
format="html" navtitle="3.4.3"/>
<topicref href="https://www.eucalyptus.com/eucalyptus-cloud/documentation/eucalyptus/3.3"
scope="external" format="html" navtitle="3.3.2"/>
<topicref href="https://www.eucalyptus.com/eucalyptus-cloud/documentation/eucalyptus/3.2"
scope="external" format="html" navtitle="3.2.2"/>
<topicref href="https://www.eucalyptus.com/eucalyptus-cloud/documentation/eucalyptus/3.1"
scope="external" format="html" navtitle="3.1.2"/>
<topicref href="https://www.eucalyptus.com/eucalyptus-cloud/documentation/eucalyptus/3.0"
scope="external" format="html" navtitle="3.0.2"/>
</topicref>
Any ideas?

Re: WebHelp ditamap external scope link

Posted: Mon Aug 11, 2014 4:16 pm
by Radu
Hi Scot,

I consider this a bug in Oxygen.
We will rectify this in the next Oxygen version (16.1).
In the meantime as a workaround, you can open the XSL:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp/xsl/dita/tocDita.xsl

search for the code:

Code: Select all

            <xsl:if test="@outputclass">
<xsl:attribute name="outputclass" select="@outputclass"/>
</xsl:if>
and after it add:

Code: Select all

            <xsl:if test="@scope and not(@scope='local')">
<xsl:attribute name="scope" select="@scope"/>
</xsl:if>
Then in the XSL:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\xsl\createMainFiles.xsl

search for the code:

Code: Select all

<a href="{@href}">
and add inside it:

Code: Select all

              <xsl:if test="@scope='external' or @scope='peer'">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
so that it becomes something like:

Code: Select all

            <a href="{@href}">
<xsl:if test="@scope='external' or @scope='peer'">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:value-of select="$title"/>
</a>
Regards,
Radu

Re: WebHelp ditamap external scope link

Posted: Tue Aug 12, 2014 1:15 am
by scotmarvin
Thanks, Radu. That definitely generates the target="_blank". Unfortunately, the link still opens in the webhelp content pane. It's weird because the code to open the link in a new window gets generated.

I'm just going to create a link to a dita topic and put the links in there.

Re: WebHelp ditamap external scope link

Posted: Tue Aug 12, 2014 7:50 am
by Radu
Hi Scot,

Funny, this worked for me. Could you tell me what version of Oxygen you have?

Regards,
Radu

Re: WebHelp ditamap external scope link

Posted: Wed Aug 13, 2014 3:08 pm
by Radu
Hi Scot,

We found out one more modification needs to be made in one of the Javascript files used for WebHelp output.
If you are still interested to test this just drop us an email to support@oxygenxml.com.

Regards,
Radu

Re: WebHelp ditamap external scope link

Posted: Wed Apr 01, 2015 9:10 am
by Radu
Hi,

Just to update this thread, this issue is fixed in Oxygen 16.1.

Regards,
Radu

Re: WebHelp ditamap external scope link

Posted: Wed Mar 15, 2017 11:59 pm
by kmank
As a side thought of this older thread... is there a way in 18.1 to open it in the content pane instead of a new window?

Re: WebHelp ditamap external scope link

Posted: Fri Mar 17, 2017 6:18 pm
by alin
Hello,

There is no setting that would enable such a behavior. I have registered your request in our issue tracking tool.

A workaround is to contribute a custom JavaScript code that removes the target="_blank" attributes from the external links elements.
However this is a partial fix, as the links would be opened in the same window, replacing the entire window content.


Regards,
Alin