Headers and footers
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 53
- Joined: Wed Mar 27, 2019 10:12 am
Headers and footers
Post by Manohar_1024 »
Hello,
I want to have different footer for each topic.
For Example:
Topic 1: in footer "indent no: 3ABC 411490"
Topic 2: in footer "indent no: 3ABC 411497"
Topic 3: in footer "indent no: 3ABC 411459"
I am using Dita with css Transformation. Can you please help me in achieving this.
Thank you,
Manohar.
I want to have different footer for each topic.
For Example:
Topic 1: in footer "indent no: 3ABC 411490"
Topic 2: in footer "indent no: 3ABC 411497"
Topic 3: in footer "indent no: 3ABC 411459"
I am using Dita with css Transformation. Can you please help me in achieving this.
Thank you,
Manohar.
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Headers and footers
It is possible to dynamically change the header depending on the content in a topic.
The following example assumes that the data to be presented in the header is located in the metadata section of each topic. One way is to specify it in the DITA map is by using the topicmeta element for the topicref topic reference:
In the above example, there is set of key value pairs with the name header-data. This information is automatically copied into the content in the merged map file, like this:
This information can be extracted from the CSS:
The string set is applied to all pages that follow the data element, until another data element changes it:
Hope this helps!
Costin
The following example assumes that the data to be presented in the header is located in the metadata section of each topic. One way is to specify it in the DITA map is by using the topicmeta element for the topicref topic reference:
Code: Select all
...
<topicref href="topics/installing.dita">
<topicmeta>
<data name="header-data" value="ID778-3211"/>
</topicmeta>
...
Code: Select all
<topic ... >
<title class="- topic/title ">Installing</title>
<shortdesc class="- topic/shortdesc ">You install components to make them available for your
solution.</shortdesc>
<prolog class="- topic/prolog ">
...
<data class="- topic/data " name="header-data" value="ID778-3211"/>
...
Code: Select all
/* Define the string set variable that contains the text extracted from the data element */
*[class ~= "topic/topic"] *[class ~= "topic/data"][name="header-data"] {
string-set: hdrstr attr(value);
}
/* Using the value='none' stops applying the image. */
*[class ~= "topic/topic"] *[class ~= "topic/data"][name="header-data"][value="none"] {
string-set: hdrstr "";
}
/* Use the string set variable in one of the page margin boxes. */
@page chapter {
@top-left-corner {
content: string(hdrstr);
}
}
Code: Select all
<topicref href="topics/installing.dita">
<topicmeta>
<data name="header-data" value="ID778-3211"/>
</topicmeta>
</topicref>
<topicref href="..."> <!-- Uses the same value -->
<topicref href="..."> <!-- Uses the same value -->
<topicref href="..."> <!-- Uses the same value -->
<topicref href="topics/change.dita">
<topicmeta>
<data name="header-data" value="ID990-3200"/>
</topicmeta>
</topicref>
<topicref href="..."> <!-- The string set is changed now -->
<topicref href="..."> <!-- The string set is changed now -->
<topicref href="..."> <!-- The string set is changed now -->
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service