Custom topic template: 1st Heading strangeness

This forum is for all Flare issues not related to any of the other categories.
Post Reply
royj
Propeller Head
Posts: 71
Joined: Mon Feb 13, 2006 1:19 pm
Location: Fargo, ND
Contact:

Custom topic template: 1st Heading strangeness

Post by royj »

One of the features I've always liked about the process of creating a new topic in Flare is that you can have the file name become the first header in the topic.

However, I find that feature doesn't seem to want to work when I use custom templates.

Here's what I do:
1) I created my custom template files, and stored them in \My Documents\My Templates\Content.
2) In my project, I open the Content Explorer, select a content folder, and then right-click > Add Topic. (Ctrl+T gets you to the same place.)
3) In the Add New Topic window, I click My Templates, and then select a custom template from the Templates list. I enter a new file name, and leave the 1st Heading field blank, then select the Stylesheet, and the Heading style to apply.
4) Click Add. The new topic is added to the project, but the first heading in the file is the default text from the template--"Topic title"--and the heading style doesn't match the choice I made in the Add New Topic window, either.

Also, it doesn't work if I do enter text in the 1st Heading field.

Is there something I need to do to my template to make this work? I've compared mine to the Factory template (stored in \Program Files\MadCap Software\MadCap Flare V3\Flare.app\Resources\English\Templates\Content), but it doesn't look as if anything special is going on there. Here's the html of the NewTopic.htm factory template:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd">
<head>
</head>
<body>
<h1>Topic Title</h1>
<p>Delete this text and replace it with your own content.</p>
</body>
</html>

Here's the html of my custom template:

<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" xml:lang="en-us">
<body>
<h1>Topic title</h1>
<p class="ManualText">Use the paragraph or paragraphs here to provide overview information about the procedure or procedures you're documenting.</p>
<ol start="1" class="ol_2">
<li>Type Step 1 here. The first step of most procedures will be a navigation step. </li>
</ol>
<ol start="2" class="ol_2">
<li>Type Step 2 here. </li>
</ol>
</body>
</html>

Am I doing something wrong, or will the 1st Heading field (and Style field) just not work with custom templates?
Roy Jacobsen
Writing, Clear and Simple
Fargo, ND
royj@writingclearandsimple.com
http://rmjacobsen.squarespace.com
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Custom topic template: 1st Heading strangeness

Post by doc_guy »

Your code sample doesn't include the <head></head> pair. I wonder if that is the culprit? I get headings/styles to work properly with custom templates, so it IS possible.
Paul Pehrson
My Blog

Image
royj
Propeller Head
Posts: 71
Joined: Mon Feb 13, 2006 1:19 pm
Location: Fargo, ND
Contact:

Re: Custom topic template: 1st Heading strangeness

Post by royj »

Thanks for the suggestion. I tried adding the <Head></Head> pair, and it doesn't change the behavior I'm getting. I also discovered that the indents in my template were spaces, while the ones in the factory template were actually tabs. However, changing the indents to match the factory template hasn't fixed it either. (Hey, anything is possible, eh?)

Out of curiosity, how did you create your custom template: Did you modify a copy of the factory template, or did you create one from scratch?
Roy Jacobsen
Writing, Clear and Simple
Fargo, ND
royj@writingclearandsimple.com
http://rmjacobsen.squarespace.com
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Custom topic template: 1st Heading strangeness

Post by doc_guy »

I copied the factory template to a new templates directory, then edited those files.

That's weird. I'm not sure why your templates aren't working like you expect. I wonder if somebody in Support would be able to help if they saw your project files.
Paul Pehrson
My Blog

Image
royj
Propeller Head
Posts: 71
Joined: Mon Feb 13, 2006 1:19 pm
Location: Fargo, ND
Contact:

Re: Custom topic template: 1st Heading strangeness

Post by royj »

I logged a support request today, so I hope to have some action on this by tomorrow. (One of the nicest things about Platinum support: the 24-hour turnaround.)
Roy Jacobsen
Writing, Clear and Simple
Fargo, ND
royj@writingclearandsimple.com
http://rmjacobsen.squarespace.com
royj
Propeller Head
Posts: 71
Joined: Mon Feb 13, 2006 1:19 pm
Location: Fargo, ND
Contact:

Re: Custom topic template: 1st Heading strangeness

Post by royj »

Neal Pozner informs me that this is a known bug. <sigh>

I created my template from scratch; I'll have to try going your route, and make copies of the factory templates to modify.
Roy Jacobsen
Writing, Clear and Simple
Fargo, ND
royj@writingclearandsimple.com
http://rmjacobsen.squarespace.com
NorthEast
Master Propellus Maximus
Posts: 6373
Joined: Mon Mar 05, 2007 8:33 am

Re: Custom topic template: 1st Heading strangeness

Post by NorthEast »

Basically, none of the heading options seem to work if you have anything in your template file in between the <body> tag and <h1> tag - i.e. the you can't have any content above the heading.
wvnomad
Propeller Head
Posts: 36
Joined: Wed Apr 02, 2008 6:10 am

Re: Custom topic template: 1st Heading strangeness

Post by wvnomad »

I was experiencing the same issue with Flare not picking up my file name.

On the facility where I work, we are required to put a code header into each file we change to track the changes. These code headers look thus:

<!-- Modifications
Date Author Ticket# Description

-->

I tried putting this comment between <head></head> tags but the file name wasn't appearing. I next tried between the <body> and <h1> tags, but with the same result. Finally, I placed it under <h1> tag and the file name functionality worked properly.

I love these forums!
wclass
Propellus Maximus
Posts: 1238
Joined: Mon Feb 27, 2006 5:56 am
Location: Melbourne, Australia

Re: Custom topic template: 1st Heading strangeness

Post by wclass »

I have got templates to work as expected like this:

Code: Select all

 ...
  <body>
	  <h1>Topic Title</h1>
       ...
Here, the "Topic Title" has to match exactly - that includes the upper/lower case, and it has to be immediately after the "body" tag. I tried putting the modification comments into the head section and the file name and title were picked up OK.
Margaret Hassall - Melbourne
muraxa
Jr. Propeller Head
Posts: 1
Joined: Thu Mar 26, 2009 1:34 am

Re: Custom topic template: 1st Heading strangeness

Post by muraxa »

The solution that wclass suggested still doesn't work if there is anything between <body> tag and <h1> tag - and I need to have a snippet inserted there.

I tried using System Variable “Title” instead in the Template but to no avail. When adding a new topic to TOC I specify a file name and the first heading, which in my case have to be different. But when the topic is added, in TOC its file name, not the heading appears and the same in the topic itself – the first heading shows the file name, not what I have entered in the First Heading field.

I opened the topic in the text editor and realized that there is to title tag at all – this probably causes the problem. The only way to fix this is to open the Topic Properties form and enter there the Topic title. But again on the form it says “It defaults to 1st heading in topic” when in fact it is empty.
I don’t understand why all this is so mixed up… :?
Post Reply