Page 1 of 1

Testing the input map name

Posted: Wed Apr 20, 2016 12:06 am
by misty
Hi,

I'd like to add a link to the top of the webhelp TOC. If my input map is called foo.ditamap, I want the link to point to the output of bar.html. If my input map is called bar.ditamap, I want the link to point to the output of foo.html. So far I have this, but I'm not sure what I am able to test:

Code: Select all

                <div id="toggle_foo_or_bar_link">
                  <xsl:choose>
                    <xsl:when test="">
                      <p>You are viewing the Foo docs. View the <a href="bar.html" target="_blank">Bar</a> docs instead.</p>
                    </xsl:when>
                    <xsl:otherwise>
                      <p>You are viewing the Bar docs. View the <a href="foo.html" target="_blank">Foo</a> docs instead.</p>
                    </xsl:otherwise>
                  </xsl:choose>
                </div>


Can I access

Code: Select all

dita.input.filename
from within the Webhelp transform? If so, then I can test based on that. I have looked in the transform and I can't see where you parse it at all.

Re: Testing the input map name

Posted: Wed Apr 20, 2016 2:36 pm
by radu_pisoi
Hi,

To get the URL of the current processed DITA map you could use the document-uri() function. To find its name, you could use the function tokenize(document-uri(.), '/')[last()].

However, the next oXygen version that will be available until the end of this month, will include a new HTML output: Webhelp Responsive. This output is based on HTML templates and it is more easy to customize that the current WebHelp out. It has already defined empty place holders you can use to include custom HTML fragment in your publication, like external links for your case.