Add topic heading/title in the header of printed output

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
hoffie4
Propeller Head
Posts: 27
Joined: Wed Sep 07, 2016 12:29 pm
Location: San Diego, CA

Add topic heading/title in the header of printed output

Post by hoffie4 »

I have used Flare to create an online knowledge base with a bunch of topics that fall under several categories. My goal is to be able to export all of these topic files as PDFs, and each individual topic needs to be it's own short PDF (because each topic is independant of the others, which is why I can't just export one long manual). So i created a custom Page Layout to format everything like I want it to look like, and this includes a footer with company info like phone number and address and stuff as variables and I have a header with our company logo and the title of the document (which is the same as the title of the topic). I also created a TOC to identify all of the topics to be included and I created a custom Target in which I selected "Generate multiple documents for native XPS/PDF output." This has allowed my output to generate a PDF for each topic in the TOC.

The issue that I am running into is that I can't figure out a way to add some sort of dynamic title into the Page Layout so that each PDF that I output has the Topic title or the text using my DocumentTitle style class in the document header. As it is, I can only specify a single value that appears in all of the outputted PDFs. I can't use a separate TOC or Target for each topic because there are just too many of them (probably around 75-100).

Is there any way to add a dynamic value in my Page Layout that specifies the Title value to be whatever the Topic title is or whatever the text of a specific style class (my DocumentTitle style) within each topic is?
Last edited by hoffie4 on Wed Nov 09, 2016 4:14 pm, edited 1 time in total.
Techno
Sr. Propeller Head
Posts: 193
Joined: Fri Dec 09, 2005 9:23 pm
Location: NORTHAMPTON, England, UK
Contact:

Re: How to add topic heading/title in the header of printed

Post by Techno »

Would it be acceptable to use the Topic's Heading (i.e. h1, h2, h3 etc.) as the Running Page Header?

I have yet to try this myself (and will be very soon), but if you go to the Variables folder, right click, then select "Variable Set", all being well under "Factory Templates" you should see "Running HF".

FWIW I created my Variables table simply called "Header_Footers".

When I look at the new table I see "Running H/F 1" defined as <$paratext[h1]>. There are six numbered accordingly 1 thru 6.

I need to do some reading up, but I suspect this may be what we both want in order to avoid having to created many, many Page Layouts.
George Bell
Techno-Vision Systems Ltd., U.K.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: How to add topic heading/title in the header of printed

Post by ChoccieMuffin »

hoffie4 wrote:I have used Flare to create an online knowledge base with a bunch of topics that fall under several categories. My goal is to be able to export all of these topic files as PDFs, and each individual topic needs to be it's own short PDF (because each topic is independant of the others, which is why I can't just export one long manual). So i created a custom Page Layout to format everything like I want it to look like, and this includes a footer with company info like phone number and address and stuff as variables and I have a header with our company logo and the title of the document (which is the same as the title of the topic). I also created a TOC to identify all of the topics to be included and I created a custom Target in which I selected "Generate multiple documents for native XPS/PDF output." This has allowed my output to generate a PDF for each topic in the TOC.

The issue that I am running into is that I can't figure out a way to add some sort of dynamic title into the Page Layout so that each PDF that I output has the Topic title or the text using my DocumentTitle style class in the document header. As it is, I can only specify a single value that appears in all of the outputted PDFs. I can't use a separate TOC or Target for each topic because there are just too many of them (probably around 75-100).

Is there any way to add a dynamic value in my Page Layout that specifies the Title value to be whatever the Topic title is or whatever the text of a specific style class (my DocumentTitle style) within each topic is?
You're nearly there. What you need is to insert a variable into your page layout. In the Variables dialog select the Heading variable set, and then the appropriate Level heading. I'm guessing all your topics will have the same heading level as the title, so if they all use Heading 1, then the variable you insert is Level1. In your page layout you can format the inserted variable with the DocumentTitle style.

That should do the trick.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
hoffie4
Propeller Head
Posts: 27
Joined: Wed Sep 07, 2016 12:29 pm
Location: San Diego, CA

Re: How to add topic heading/title in the header of printed

Post by hoffie4 »

Thanks for your help guys. This solved the problem perfectly. The best suggestion was actually to just use the pre-existing System variable set and select the variable called "Title" that is for the title of the topic, though it seems to take the first heading rather than the actual topic name (though they are both the same to me). I did this rather than creating a new Running H/F1 set mainly because this way was less work.

As an aside, I tried using the existing Heading variable set and selecting Level 1 to use the first heading 1 in the topic, but this actually used the first H1 that is on each page (pages with no H1 retained the previous H1). So that didn't do what I wanted, but should be useful for anyone who wants to have a variable title that reflects the current section of the document.

For anyone in the future who needs to do this, here is exactly what I did step-by-step:
  1. Open the relevant Page Layout from the PageLayouts folder (under Resources)
  2. Select the header frame (or wherever you want to add the variable) and press F2 to edit
  3. Place the cursor where you want the variable
  4. Open the Insert tab from the top ribbon menu and click Variable to insert a variable
  5. Select System under Variable Sets
  6. Select the variable named Title and click OK to insert the variable
As I've said, there are several existing variable options that you can choose to get similar results. I haven't found one that uses the topic name instead of a heading, but there is one that uses the topic file name called SourceFile. Honestly, I would just play around and add some of the different variables and test them out to verify they do what you want. You'll need to build your printed target to actually see what it generates, because for me when I look at or preview the page layout in Flare, the variable just shows the name of the page layout file (even though in the final output it is correctly using the topic title)
Matze
Sr. Propeller Head
Posts: 166
Joined: Mon Jun 20, 2016 10:35 pm

Re: Add topic heading/title in the header of printed output

Post by Matze »

But how can I prevent the h1 numbering from heading 1, I´m to stupid ... mc-autoformat-position: none doesnt work.
Matze
Sr. Propeller Head
Posts: 166
Joined: Mon Jun 20, 2016 10:35 pm

Re: Add topic heading/title in the header of printed output

Post by Matze »

now it works with the system title variable.
Post Reply