• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Document title in footer (using DITA)

New Here ,
Nov 20, 2008 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.3K

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
community guidelines
Community Beginner ,
Nov 20, 2008 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

Votes

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
community guidelines
New Here ,
Nov 20, 2008 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

Votes

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
community guidelines
Community Beginner ,
Nov 21, 2008 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

Votes

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
community guidelines
New Here ,
Nov 21, 2008 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

Votes

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
community guidelines
New Here ,
Nov 21, 2008 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

Votes

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
community guidelines
New Here ,
Nov 21, 2008 Nov 21, 2008

Copy link to clipboard

Copied

Got it. Thanks Van and Scott! Here's a summary in case anyone is interested:<br /><br />1. Edited the dita-book-fm.dtd to add support for a "doctitle" attribute in the fm-ditabook element.<br /><br />2. Made the same edit to the book.edd.fm, and imported definitions into the structured template.<br /><br />3. Edited ditamap2fmbook.xsl to include: <xsl:attribute name="doctitle"><xsl:value-of select="@title"/></xsl:attribute> in the <fm-ditabook> area.<br /><br />4. Entered a title attribute in the ditamap map element.<br /><br />5. Built the book and the fm-ditabook doctitle attribute contains the correct title from the map, which can now be used in running headers/footers.<br /><br />Seems to work well so far. Thanks again.<br /><br />Larry

Votes

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
community guidelines
New Here ,
Nov 21, 2008 Nov 21, 2008

Copy link to clipboard

Copied

Hey Larry...

That's great! This is probably something that others will want to do as well. If you can take a moment and add this to the DITA/FrameMaker Community KB, then it will be preserved for easy access by others ..

http://kb.leximation.com/dfm/

Cheers!

...scott

Votes

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
community guidelines
Participant ,
Oct 29, 2020 Oct 29, 2020

Copy link to clipboard

Copied

Does anyone know how to do this in FrameMaker 2020?

Wanda

Votes

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
community guidelines
Adobe Employee ,
Oct 29, 2020 Oct 29, 2020

Copy link to clipboard

Copied

Do check out the resources page for DITA template set up video:

https://www.adobe.com/in/products/framemaker/resources.html

 

Thanks

Votes

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
community guidelines
Participant ,
Oct 29, 2020 Oct 29, 2020

Copy link to clipboard

Copied

LATEST

Sorry, but the video wouldn't play all the way through. It kept stopping and crashing.

Wanda

Votes

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
community guidelines