TOCs Folder Sort Method

This forum is for all Flare issues not related to any of the other categories.
Post Reply
CATERAF
Sr. Propeller Head
Posts: 103
Joined: Mon Mar 18, 2013 10:19 pm
Location: Perth, Australia

TOCs Folder Sort Method

Post by CATERAF »

Hi,
This is more an 'annoyance' (except it's not that annoying really) than a real problem but thought I'd ask anyway.. there may be something I don't know about!

I have 18 TOCs sitting inside my TOC folder inside the Project Organiser. I'd like these to sort themselves alphabetically by more than just the first letter (or word perhaps? can't tell!) because currently I have a print and web TOC for each manual but they're rarely next to each other. I'm going to be adding many more manuals and I already sit there and have to hunt around to find where the other manual's TOC has got to. If you have any suggestions as to how to sort this that would be very handy :-)

To give you an idea, I'd like it to look like this.. nice and organised:

A Product Variation 1 - Web
A Product Variation 1 - Print
A Product Variation 2 - Web
A Product Variation 2 - Print.
A Product Variation 3 - Web
A Product Variation 3 - Print
B Product Variation 1 - Web
B Product Variation 1 - Print

Instead, it ends up something like this:

A Product Variation 2 - Print
A Product Variation 3 - Web
A Product Variation 1 - Web
A Product Variation 3 - Print
A Product Variation 1 - Print
A Product Variation 2 - Web
B Product Variation 1 - Web
B Product Variation 1 - Print

Imagine there are 14 'A Product' rows and have a go finding 'A Product Variation 3 - Print' and then 'A Product Variation 3 - Web' and it takes you a moment or two to find both.
Again, it's a minor technicality but does slow me down when I'm trying to go from one manual straight to the other, and back.. and when I'm having a furry-brained day, problems may ensue and I click the wrong one...

Oh, and I have checked that the titles are exactly the same except for 'Print' and 'Web' at the end so if it does sort it all alphabetically it should be sorting this too. I also find I have the same problem with my Target sorting.

Thanks!
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: TOCs Folder Sort Method

Post by Msquared »

Do these files sort alphabetically in Windows Explorer? If not, then I guess you have managed to include some non-breaking spaces in the file names which is breaking the sort order. Since Flare 9, you are able to do this, quite easily, by mistake. :-(

If you have got a non-breaking space in a filename, you will see the characters   in the source code of any Flare file that references it. For example, if you have a non-breaking space in a TOC filename, then if you open a target .fltar file that includes the TOC with a text editor, you will see something like this in the line that references the TOC.

MasterToc="/Project/TOCs/UG MasterTOC.fltoc"

In this example, the filename UG MasterTOC has a non-breaking space between UG and MasterTOC. This is a real pig to fix. If this turns out to be your problem, please, please, raise a bug report (I have) so MadCap know others are affected.

Alternatively, you can create subfolders in your TOC folder, and group your TOCS below those.
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
CATERAF
Sr. Propeller Head
Posts: 103
Joined: Mon Mar 18, 2013 10:19 pm
Location: Perth, Australia

Re: TOCs Folder Sort Method

Post by CATERAF »

Msquared wrote:Do these files sort alphabetically in Windows Explorer? If not, then I guess you have managed to include some non-breaking spaces in the file names which is breaking the sort order. Since Flare 9, you are able to do this, quite easily, by mistake. :-(
They aren't sorting in Windows Explorer either, but I can't see a non-breaking space in the text editor.. how bizarre. I tried renaming one of the out-of-place files in Windows Explorer to see if it would sort alphabetically for me but nothing changed; it stayed out of alphabetical order. Interesting.. I just tried to rename the TOC file in Flare and I got an 'unhandled exception' error.. I feel a bug report coming on.. except, I then tried closing and re-opening Flare and now I can change the name and now it's sorting it properly (I removed the spaces). Well, I'm stumped but I'm thankful to know how to get them to sort properly; don't use spaces.

I have a theory (though totally unfounded) that if you rename the TOC file after the original name and/or you add spaces to the name, Flare gets confused and doesn't alphabetise it.
Msquared wrote: Alternatively, you can create subfolders in your TOC folder, and group your TOCS below those.
Smart.. I'd rather an alphabetical workaround (less diving in and out of folders) but this sounds like a good way to go! Thanks :-)

Thanks very much for your help though -- got a workaround which is great! :D
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: TOCs Folder Sort Method

Post by Msquared »

From what you're saying, I'd say you've almost certainly got non-breaking spaces in your file names.

In Flare, you enter a non-breaking space using Shift+Space. If you are typing anything that involves spaces with upper case characters immediately before/after the spaces, sooner or later you will hold the Shift key down when you hit the space and get a non-breaking space instead. Try it in the Flare text editor and you'll see what I mean. Since Shift+Space is normally the same as just Space, most of us do it most of the time and don't even know we are doing it. You have lots of spaces that immediately precede upper case characters in your file names. So I guess when you created these files from within Flare, and gave them names, you held down Shift with the Space some of the time.

You can't see these non-breaking spaces at all, anywhere, unless you look at the raw code of another Flare file that references the file. For example, if you look in the target file, you'll see any nbsps in the TOC, stylesheets, page layout files etc.

If you say you renamed the file to replace the spaces and it isn't affecting the sort order, I'd say this was because of other nbsps elsewhere either in that file name, or other file names. Believe me, I've been there. You will have to edit and replace every single space in every single file in the folder before you have got them all and the files sort correctly. :(

Yesterday I found and fixed another batch in my own project. I always get rid of them as soon as I spot them, since they cause so much trouble in so many ways. It's a real pain to rename Flare files in Perforce, our source control system, but it's even more of a pain to leave them. In my case, I was trying to set up a global project import, and I specified a file filter of "GLOBAL " for the files to import. Several of my snippet files had nbsp after "GLOBAL" so were missed from the import. :cry:
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
CATERAF
Sr. Propeller Head
Posts: 103
Joined: Mon Mar 18, 2013 10:19 pm
Location: Perth, Australia

Re: TOCs Folder Sort Method

Post by CATERAF »

I would say it sounds like you're on the right track - I have no doubt that I would hold down the shift key while pressing space and I did rename them in a hurry so it's even more likely.
Sounds like it's caused quite a few issues for you! How would you suggest getting rid of them please?

I'm looking at the .fltar file in text editor but my MasterToc is reading with spaces as normal so I'm not seeing any nbsps..?

Thanks!
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: TOCs Folder Sort Method

Post by Msquared »

The first problem is to identify them. I'm seriously thinking of writing a windows script to do this when I get a minute. Such files are invisible to the naked eye, unless you happen to spot the "&#160:" character sequence in a link to a file from another Flare file, or strongly suspect there is a problem because that's the only explanation for the oddness you are seeing

To get rid of them, you need to edit the filename of every single affected file. Once you've identified a problem file, I've found it's easiest to delete every single space in the filename, then insert a known normal space, whether or not there was a known nbsp at a particular location. If, like me, you use a lot of spaces in your filenames, then, for a filename with a known problem, it's easier to assume all the spaces are potentially wrong than fiddle trying to change just those that are wrong.

Sorry to be the bringer of bad news.

You can help by reporting this to MadCap as a bug, and stressing how much trouble it has caused you. The more of us that report it, the more likely it is to be fixed. This was only introduced in Flare 9, and I think Flare 9.1.2 no longer allows you to create topic files with nbsp in the filenames, but there is still a way to go before this is fixed completely.
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
Post Reply