Warning Messages

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Shredder
Propeller Head
Posts: 43
Joined: Fri Sep 18, 2020 4:42 am

Warning Messages

Post by Shredder »

Hi folks,

as we manufacture machinery, our handbooks must have warning messages and safety notes that are compliant with ANSI 535.6 and EN 82079-1, ISO 3864 etc. As such, we require a symbol, and the correct text.

DITA has the hazard statement element, for example:

<hazardstatement type="warning">
<messagepanel>
<typeofhazard>Hot surfaces inside.</typeofhazard>
<consequence>Contact may cause burn.</consequence>
<howtoavoid>Wear protective gear before servicing internal parts.</howtoavoid>
</messagepanel>
<hazardsymbol href="hotsurface.png"/>
</hazardstatement>

I must replicate this in MadCap Flare. The text content is covered by the style guide I am developing. However, I also need to create warning messages as block snippets based on our risk analyses. These block snippets would be single-sourced and reused throughout all of our projects.

Naturally, I googled, and found this:

https://3di-info.com/single-sourcing-an ... cap-flare/

This would basically mean creating a style sheet specifically for warning messages implement as block snippets, right? This would require manually applying the style sheet for the print output, overriding the master style sheet?

Does anyone do it similarly, or have helpful tips here?
Psider
Propellus Maximus
Posts: 816
Joined: Wed Jul 06, 2011 1:32 am

Re: Warning Messages

Post by Psider »

It says each output/target has a different stylesheet, rather than one for the warnings. So Web, Print_A5, Print_Letter. Possibly Print_A5_CN.

It doesn't say, but it might use @import, so that you have all your styles defined in one stylesheet, then output specific stylesheets which "import" the main stylesheet, and specify output specific differences only, like larger symbols in the Letter output than the A5 output (not sure what a real life example for the warnings might be :) ).

I think it's called linking in Flare.

So. Random, non-realistic example, just for illustration. You want your heading 1 to be the same in all your outputs, but the hazard image size needs to be different in A5 and Letter print outputs.

Your main.css might look like:

Code: Select all

h1 {
 font-size: 20px;
}
p.HazardSymbol {
 width: 200px;
}
Your Print_A5.css might look like:

Code: Select all

@import url('main.css');

p.HazardSymbol {
 width: 50px;
}
And your Print_Letter.css might be:

Code: Select all

@import url('main.css');

p.HazardSymbol {
 width: 100px;
}
If you don't need to customise for different outputs, then you wouldn't need the separate stylesheets at all, and can just define them in your main stylesheet.

This is all theorising on my part, but hopefully at least something to think about until someone with concrete experience comes along.
Shredder
Propeller Head
Posts: 43
Joined: Fri Sep 18, 2020 4:42 am

Re: Warning Messages

Post by Shredder »

Thanks for the answer! I am a total newbie to CSS.

I decided it'd be best to have safety notes and warning messages as block snippets and store them in a common/ global folder. But I probably will have to create a separate CSS style for them, as they must clearly stand out and be differentiated from the normal text body. Happy happy joy joy!
Psider
Propellus Maximus
Posts: 816
Joined: Wed Jul 06, 2011 1:32 am

Re: Warning Messages

Post by Psider »

Ahh. Let me take a step back. :)

Yes, you'll need styles for the text in your snippets. The snippet just lets you keep the text in a central spot for re-use. You should be able to set it all up in your main stylesheet using the Flare editor without needing to know much in the way of css or html. The only thing you might need is a div, which I think you can add by selecting multiple paragraphs and selecting Group from somewhere? My memory is a bit fuzzy on how to do it, but it's definitely in the menus.

If you only have one output, or don't need to change the styles for different outputs, you only need one stylesheet which contains all styles including your warning styles.

If you need multiple outputs and the look of the warnings must be different in each output, you may need the linked stylesheets I mentioned in my other post. You may also need this if you translate, but I'm not exactly sure how translation works.

hth
Shredder
Propeller Head
Posts: 43
Joined: Fri Sep 18, 2020 4:42 am

Re: Warning Messages

Post by Shredder »

Thanks! Looking at the "Creating Divs and Other Tag Groups" chapter of the help documentation will surely keep me busy, at least for a few hours. :flare:
Shredder
Propeller Head
Posts: 43
Joined: Fri Sep 18, 2020 4:42 am

Re: Warning Messages

Post by Shredder »

Psider wrote:Ahh. Let me take a step back. :)

Yes, you'll need styles for the text in your snippets. The snippet just lets you keep the text in a central spot for re-use. You should be able to set it all up in your main stylesheet using the Flare editor without needing to know much in the way of css or html. The only thing you might need is a div, which I think you can add by selecting multiple paragraphs and selecting Group from somewhere? My memory is a bit fuzzy on how to do it, but it's definitely in the menus.

If you only have one output, or don't need to change the styles for different outputs, you only need one stylesheet which contains all styles including your warning styles.

If you need multiple outputs and the look of the warnings must be different in each output, you may need the linked stylesheets I mentioned in my other post. You may also need this if you translate, but I'm not exactly sure how translation works.

hth
Haha, now I encountered another wee problem. To create hyperlinks for images, you need to insert them into a topic first, right? So basically I could create a "dud" topic for all symbols used in snippets and topics? Would that be a good idea?
Psider
Propellus Maximus
Posts: 816
Joined: Wed Jul 06, 2011 1:32 am

Re: Warning Messages

Post by Psider »

Just insert the image in the snippet where you want to use it. If you're worried that it's going to create a copy of the image, it doesn't. It's just a link back to where the image lives. If I've misunderstood your concern, post back with some more information about what you're trying to do.

If you're a brand new Flare user, could I suggest working through the Getting Started tutorial? It covers the basics of getting started with Flare, topics, images, snippets, styles, table of contents, targets, etc.
https://help.madcapsoftware.com/flare20 ... torial.htm
Shredder
Propeller Head
Posts: 43
Joined: Fri Sep 18, 2020 4:42 am

Re: Warning Messages

Post by Shredder »

[quote="Psider"]Just insert the image in the snippet where you want to use it. If you're worried that it's going to create a copy of the image, it doesn't. It's just a link back to where the image lives. If I've misunderstood your concern, post back with some more information about what you're trying to do.

If you're a brand new Flare user, could I suggest working through the Getting Started tutorial? It covers the basics of getting started with Flare, topics, images, snippets, styles, table of contents, targets, etc.
https://help.madcapsoftware.com/flare20 ... torial.htm[/quot

Thanks, I chewed through the introductory course last week. It was very basic, but is a matter of course for such a kind of course. :wink:

So to be more specific:

Goal: Warning messages as block snippets.

Target: PDF/ print

Path a: Table with a table style
OR
Path b: a div style.

Path a: Column 1 is two cell rows merged and contains the ISO 7010 hazard symbol ⚠️, aligned with the top border of the cell. Column 2, row 1 has/ should have #f2ad00 as the background color. Alternatively, the outer border of the table can have #f2ad00 as colour. Column 2, row 1 also contains the signal word (Warning!, Caution!, Notice!, Danger!). Column 2, row 2 contains the text (content spec: type of hazard, consequence, how to avoid). Struggling with configuring the table style. Any tips?

Path b: Alternatively, the div style should contain the ⚠️ symbol on the left, and have a thick border with the colour #f2ad00. Text on the right (with the same content specs as path a). For the div to work, I apparently need an URI to the image to use it as the background image, e.g. background-image: url(../Images/icons/Pencil-48.png). Compare here: https://www.madcapsoftware.com/blog/css ... ples-tips/ Any tips?

I also had to create an image style to resize the rather large SVG to a smaller 12 x 14 mm.
Psider
Propellus Maximus
Posts: 816
Joined: Wed Jul 06, 2011 1:32 am

Re: Warning Messages

Post by Psider »

You can access the background-image property in the stylesheet editor and then just browse for the image you want. I usually make sure all the images I want to reference are in the images folder before I start (I can't remember if it imports them into the project for you). You might need to switch to Advanced View and select Show > All Properties to be able to see the background properties. I'd assume you need to also set background-size as you can't apply a style to background image. I'm not sure if you can apply a border around the background image, you'll have to investigate that.

If you find you can't apply a border you definitely need, it would be easiest to include the border in the image itself. But if you can't do that for some reason then you might need to go with the table example. I can't give you any specific advice on trying to get a table style set up - it's very powerful, but initially confusing and I need to have the interface in front of me. Hopefully someone else comes along and can provide information based on your description. I do recommend setting up a test project and playing around with the table editor, changing one thing at a time to get the hang of it. Also read through the Editing table styles topic and study the images - I find the illustrations help as I'm trying some of the things the topic describes.
Post Reply