WebHelp ditamap external scope link

Post here questions and problems related to editing and publishing DITA content.
scotmarvin
Posts: 18
Joined: Thu Aug 27, 2009 5:09 pm

WebHelp ditamap external scope link

Post 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?
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: WebHelp ditamap external scope link

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
scotmarvin
Posts: 18
Joined: Thu Aug 27, 2009 5:09 pm

Re: WebHelp ditamap external scope link

Post 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.
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: WebHelp ditamap external scope link

Post by Radu »

Hi Scot,

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

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: WebHelp ditamap external scope link

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: WebHelp ditamap external scope link

Post by Radu »

Hi,

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

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
kmank
Posts: 118
Joined: Mon Apr 19, 2010 5:33 pm

Re: WebHelp ditamap external scope link

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

Re: WebHelp ditamap external scope link

Post 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
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply