Reputation: 64226
Given that the table-of-contents area for web output is rather narrow I would like to assume smaller navigation titles for web, but continue to present long topic titles in PDF output.
The following markup does not seem to work at all (with or without the audience
attribute):
<task id="guid-76a10a16-9952-44fa-ad32-9b9cf2c3eee6">
<title>Primary Topic Title</title>
<titlealts audience="web">
<navtitle>Short Title</navtitle>
</titlealts>
</task>
Adding locktitle="yes"
in the map also did not seem to make any difference:
<topicref type="task" href="primary-topic-title.dita" locktitle="yes"/>
The following works for web, but unfortunately also presents short titles in the PDF table-of-contents:
<topicref type="task" href="primary-topic-title.dita" locktitle="yes">
<topicmeta>
<navtitle>Short Title</navtitle>
</topicmeta>
</topicref>
I tried using the following to target Web and PDF separately, but this caused errors to occur during the transform process stating that I was attempting to reference topics outside of the processing context. This works fine for web, but when examining the PDF output there are links to the ".dita" files using the "file:/" protocol instead of cross-references within the PDF file.
<topicref audience="pdf" type="task" href="primary-topic-title.dita"/>
<topicref audience="web" type="task" href="primary-topic-title.dita" locktitle="yes">
<topicmeta>
<navtitle>Short Title</navtitle>
</topicmeta>
</topicref>
Note: I am using the Ditac processor by XML Mind
Upvotes: 0
Views: 453
Reputation: 310
Although I'm not familiar with the DITAC tool specifically, I will describe the approach that will work in the DITA Open Toolkit and and other tools offering full support for the DITA spec.
Your original approach is the right one:
<task id="guid-76a10a16-9952-44fa-ad32-9b9cf2c3eee6">
<title>Primary Topic Title</title>
<titlealts audience="web">
<navtitle>Short Title</navtitle>
</titlealts>
</task>
Your processing must use a different ditaval file for PDF and web output. The PDF ditaval file must include:
<prop action="exclude" att="audience" val="web" />
The web ditaval file must include:
<prop action="include" att="audience" val="web" />
Upvotes: 2
Reputation: 5892
Unfortunately DITA has only the print
attribute to filter based on the output type and it cannot directly be used on navtitle
element. You could use
<topicref print="printonly" href="primary-topic-title.dita"/>
<topicref print="no" href="primary-topic-title.dita" locktitle="yes">
<topicmeta>
<navtitle>Short Title</navtitle>
</topicmeta>
</topicref>
But that would be duplicating the topic references. It may be easier to add a custom profiling attribute based on props
and filter based on that. That way you can only condition the navtitle
.
Upvotes: 1