WebHelp ditamap external scope link

scotmarvin
Posts: 18

WebHelp ditamap external scope link

Sun Aug 10, 2014 5:39 am

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: 5221

Re: WebHelp ditamap external scope link

Mon Aug 11, 2014 4:16 pm

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

Re: WebHelp ditamap external scope link

Tue Aug 12, 2014 1:15 am

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: 5221

Re: WebHelp ditamap external scope link

Tue Aug 12, 2014 7:50 am

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: 5221

Re: WebHelp ditamap external scope link

Wed Aug 13, 2014 3:08 pm

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: 5221

Re: WebHelp ditamap external scope link

Wed Apr 01, 2015 9:10 am

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: 75

Re: WebHelp ditamap external scope link

Wed Mar 15, 2017 11:59 pm

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: 111

Re: WebHelp ditamap external scope link

Fri Mar 17, 2017 6:18 pm

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

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests