Updating topic title after renaming topic

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Centauri27
Sr. Propeller Head
Posts: 134
Joined: Thu Apr 17, 2008 11:30 am
Location: Vancouver, BC, Canada

Updating topic title after renaming topic

Post by Centauri27 »

I just finished renaming many topics in my project. To prevent problems, I always have the topic title, topic file name, and the first major heading within the topic the same. During my rename, I updated the topic heading and topic file name, but I didn't update the topic title. I had assumed (incorrectly) that it would be updated based on the heading. Turns out it only defaults to the first heading and after that, you're on your own. :|

Here's my question: is there an easy way to update all the topic titles to match the first heading in the topic? Nearly 100 topics are affected, so I'd hate to have to update them all manually one at a time.

On a related note, would you consider this a "bug" in Flare, a "design oversight", or just a case of "the user doesn't know how to use the product properly"? I suspect it's all three, but it would sure be nice if Flare could auto refresh the titles, or at least prompt you with, "Also update the topic title? [Yes] [No]" when you rename the file.

Many thanks.
Carl Lum
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Updating topic title after renaming topic

Post by LTinker68 »

Are you talking about the value of the <title> tag? If that tag isn't populated then it defaults to using the first heading in the topic. That tag isn't actually tied into the first heading -- Flare makes the association during the build process, but even then, I don't think it adds a <title> tag to the topic. It's only if you manually populate the field in the topic's Properties screen that the <title> tag is added and populated.

If you have no real need to have the <title> tag, then you can do a find-and-replace in Flare using regular expressions to delete the entire <title> tag and its contents from every topic.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Centauri27
Sr. Propeller Head
Posts: 134
Joined: Thu Apr 17, 2008 11:30 am
Location: Vancouver, BC, Canada

Re: Updating topic title after renaming topic

Post by Centauri27 »

Thanks, Lisa--removing all the "<title>" tags did the trick! With no titles, Flare now defaults to using the topic heading for things like searches in the WebHelp. Whacking them all using a regex expression was sure faster than manually resetting all the topic titles (which was my worse case scenario)! :)

The regex expression to do this was fairly tricky. It took a bit of searching, but I finally found that this expression does the trick. Here's hoping that this will save others from some grief:

Code: Select all

<title[^>]*>(.*?)</title>
This nifty expression can find any contiguous tag in the code. (I haven't yet figured out how to find tags that break over a line.)

However, I've found one topic that stubbornly continues to show the old name in the WebHelp search, even though there's no trace of the old name in the topic code, and despite the "<title>" tag being removed from it. It's driving me crazy.

Finally, here's one more related obstacle: is there any similar trick to update the labels in the TOC without having to manually rename them all?

Thanks again.
Carl
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Updating topic title after renaming topic

Post by LTinker68 »

Centauri27 wrote:Finally, here's one more related obstacle: is there any similar trick to update the labels in the TOC without having to manually rename them all?
No quick way to do that, I don't think. That would be a great utility, though -- make sure you submit a feature request, something along the lines of "update TOC titles to match first heading" or something like that.

Your options are to either drag the topics into the TOC again and reset the print-specific features on the books (if applicable), or manually renaming each topic (which leaves the existing print-specific features in place). I'd be more apt to do the former, since I only modify the print-specific features on the books, not every topic, so there are fewer items to modify than if you did the latter option. If you do the former, I recommend dragging the topics, setting up the book and the order of the topics, then deleting the previous version of the book and its topics. Or make a copy of the old TOC file as a backup reference as you recreate the TOC.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Updating topic title after renaming topic

Post by KevinDAmery »

LTinker68 wrote:No quick way to do that, I don't think. That would be a great utility, though -- make sure you submit a feature request, something along the lines of "update TOC titles to match first heading" or something like that.
In case you're not familiar with it, you can submit bugs and feature requests here:

http://www.madcapsoftware.com/bugs/submit.aspx
Until next time....
Image
Kevin Amery
Certified MAD for Flare
Centauri27
Sr. Propeller Head
Posts: 134
Joined: Thu Apr 17, 2008 11:30 am
Location: Vancouver, BC, Canada

Re: Updating topic title after renaming topic

Post by Centauri27 »

Well I'll be darned....it seems that deleting all the <title> tags does in fact update the corresponding TOC entries...but only for 98% of the cases. There are still a few topics that stubbornly cling to the old name for whatever reason. I'll keep poking around, but at least this saves me a huge chunk of work. I'll still file a feature request though.

Carl
homerchristensen
Jr. Propeller Head
Posts: 9
Joined: Wed Sep 09, 2009 12:15 pm
Location: folsom, california
Contact:

Re: Updating topic title after renaming topic

Post by homerchristensen »

Just wanted to say that this has saved my bacon a few times... and wanted to give some props to Lisa and Carl.
Whenever you import a word file, Flare automatically creates the title tag with the first header of the topic. To keep our TOC accurate and (as we often import the screen topics from the developer) our CSH links working, I use this each project/phase.
Thank you!
Centauri27 wrote:Thanks, Lisa--removing all the "<title>" tags did the trick! With no titles, Flare now defaults to using the topic heading for things like searches in the WebHelp. Whacking them all using a regex expression was sure faster than manually resetting all the topic titles (which was my worse case scenario)! :)

The regex expression to do this was fairly tricky. It took a bit of searching, but I finally found that this expression does the trick. Here's hoping that this will save others from some grief:

Code: Select all

<title[^>]*>(.*?)</title>
----
r. n. homer christensen
http://homerchristensen.com
rob hollinger
Propellus Maximus
Posts: 661
Joined: Mon Mar 17, 2008 8:40 am

Re: Updating topic title after renaming topic

Post by rob hollinger »

Here is another one that will include white space and line breaks..
replace tags as needed.

Code: Select all

Using <style>(?<=^|>)[^><]+?(?=<|$)</style> will select the inline stylesheet. 
Searches for <style>
(?<=^|>)[^><]+?(?=<|$) = anything between two HTML tags including linebreaks and white space. 
To the ending html tag </style>
Rob Hollinger
MadCap Software
Post Reply