Highlighted

Document title in footer (using DITA)

New Here ,
Nov 20, 2008

Copy link to clipboard

Copied

We want to put our document title in the footer. I did it by editing the FM template to include an empty DocTitle variable, and importing a DocTitle variable from another file into the book after map-to-book.

This works well. But is there a way to accomplish something similar that doesn't require post-processing after map-to-book?

Currently, the only mention of the document title is in the title attribute of the map element in the ditamap file. Any suggestions on how to automatically pull the document title from the map attribute into the structured FM template for footer use?

If it requires much coding, it may be easier to continue the manual import. But I wanted to check in case there's a simple solution. Any thoughts?

Thanks,

Larry
TOPICS
Structured

Views

1.0K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Document title in footer (using DITA)

New Here ,
Nov 20, 2008

Copy link to clipboard

Copied

We want to put our document title in the footer. I did it by editing the FM template to include an empty DocTitle variable, and importing a DocTitle variable from another file into the book after map-to-book.

This works well. But is there a way to accomplish something similar that doesn't require post-processing after map-to-book?

Currently, the only mention of the document title is in the title attribute of the map element in the ditamap file. Any suggestions on how to automatically pull the document title from the map attribute into the structured FM template for footer use?

If it requires much coding, it may be easier to continue the manual import. But I wanted to check in case there's a simple solution. Any thoughts?

Thanks,

Larry
TOPICS
Structured

Views

1.1K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 20, 2008 0
Community Beginner ,
Nov 20, 2008

Copy link to clipboard

Copied

Larry,

I do not use DITA, but I do use structured documents and books. In structured books, one can pull in an attribute from an element as a running header or footer.

I am assuming that after you convert the map to a book, the attribute that holds the document title is in some element in the book. If so, you edit one of the running header/footer variables with the following:

<$attribute[theAttributeName:theElementName]>

If on the other hand, the title is the content of an element, use the following:

<$elemtextonly[theElementName]>

Hope this helps,
Van

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 20, 2008 0
New Here ,
Nov 20, 2008

Copy link to clipboard

Copied

Thanks for the response, Van.

You mentioned: "I am assuming that after you convert the map to a book, the attribute that holds the document title is in some element in the book."

I think that might be the issue. The attribute I need doesn't end up in the book after the map-to-book process.

Looks like I need to use the variable import method, or put the title into a topic attribute that survives the map-to-book process. I'll probably stay with the variable method, as the other would be tough to manage since topics are used in multiple documents.

Thanks again,

Larry

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 20, 2008 0
Community Beginner ,
Nov 21, 2008

Copy link to clipboard

Copied

Larry,

Just to be clear...

When you create the book from the map, select the book window and open the structure view. Does the structure view have a root element and possibly some child elements that are NOT the document root elements? If so, and I think it should be, then it seems that one of those elements should have the attribute you want. Again, just guessing because that is the way it is in structured books.

Van

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 21, 2008 0
New Here ,
Nov 21, 2008

Copy link to clipboard

Copied

The root element of the book is "fm-ditabook", with two attributes (href and format). Child "fm-ditafile" elements represent each generated FM file, and they also have two attributes (href and format).

In the ditamap, the root element is "map" and the attribute of interest is "title". This element and attribute are not carried forward during the map-to-book process.

If the map-to-book function could be modified to create and populate a title attribute in the "fm-ditabook" element (based on the ditamap "map" title attribute), I think the running header/footer variable could then access it. But I'm not sure how to modify that map-to-book function. It may require editing the XSL.

Thanks,

Larry

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 21, 2008 0
New Here ,
Nov 21, 2008

Copy link to clipboard

Copied

The map-to-book process basically works like this ..

- select command from menu
- specify output book name
- map is opened with the Book application, which runs the XSLT import script to aggregate the separate XML topic files into chapter files
- after book has been built, a process runs over the book to relink the references

Note that this assumes that you select the command from the menu rather than opening the map with the Book app .. which may seem to work, but does not properly relink the references in the generated FM files.

So, yes .. if you make tweaks to the XSLT, you should be able to get your additional attributes onto the fm-ditabook element.

Cheers,

...scott

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 21, 2008 0