Conditional stylesheets?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
ajpeck123
Propeller Head
Posts: 37
Joined: Tue Mar 07, 2017 6:01 am

Conditional stylesheets?

Post by ajpeck123 »

In my one project, I have documentation for 8 products.
The project uses the one main stylesheet for PDF output, which works for all topics except for one.

The title page in the project has a fixed-size purple box containing a text frame into which 3 of 4 variables are displayed:
  • <ProductName> or <ProductNameEdition> (depending on product)
  • <Platform> (Windows, Linux...)
  • <DocType> (Administrator Guide, Maintenance Manual, etc.)
While the values of <Platform> and <DocType> are unlikely to change and are fairly standard in size (Windows is longer than Linux, but not by that much), the values of <ProductName> and <ProductNameEdition> vary greatly in length (from 12 characters to nearly 30).

In the attached image, I have set the CSS properties for the styles to make the title fit nicely in the box, the platform to display underneath and the document type to show as well. However, if the title is much smaller than this, it looks a little lost in the box, and if much bigger, the final line (showing the document type) isn't visible. Even if it's all visible, sometimes the product name splits in strange places because of line wraps.

For speed, I simply updated the stylesheet to get the document I was working on out of the door.
I'm trying to find a way to do this once and not have to worry about it again (until we get a new product to add to the portfolio).

It feels like the only options are to:
  • Create a separate title page for each product (copied from a "master"), each with its own CSS definitions in the <head> of the topic.
  • Create separate style sheets for each product *only* containing the definitions for the three paragraphs on the title page, link ALL of them to the same "Title" topic and use condition tags to determine which is used when. (Can I even do this?)
  • Create separate style sheets for each product and specify them in each target... I assume "usual" stylesheet will be picked up for other styles.
Does anyone have any experience of this? Any "gotchas" that you can share?

Thanks in advance for any advice.
Alison
Lone technical author - Flare user since March 2017
Currently using Flare 2020
devjoe
Sr. Propeller Head
Posts: 337
Joined: Thu Jan 23, 2014 1:43 pm

Re: Conditional stylesheets?

Post by devjoe »

Didn't find an attachment in this post, but some ideas:
  • Leave the font size of the title unspecified, and apply the size as direct formatting to the title in each project to make the title fill the box.
  • Don't specify the height of the box, and let it adjust to contain its contents.
Post Reply