Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create warnings and cautions with a border

Participant ,
Sep 05, 2024 Sep 05, 2024

Hi all, I'm looking for suggestions on how I can create warnings and cautions that will look like the Warning in my example with a border around it. I've created this example by just drawing a rectangle for display purposes but obviously that method doesn't automatically move with the text. I'm trying to avoid using tables to achieve this as they don't publish to HTML in a way that works well. You can see by the text symbols that there's two separate paragraph styles involved, as well as an inline image. I'd like the output to be centred with large left and right indents for both PDF and HTML5 (and that's where I struggle with the tables). Does anyone have any ideas? warnings.png

1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Sep 23, 2024 Sep 23, 2024

Hi Matt,

sorry for my late feedback. Now I'm back from vacation.

Thank you very much for your tip with the pseudo elements. I will try to use a pseudo element "::before" for the class of my signal words in warning hints like this:

p.SafetyHint__SignalWord::before {
    content: "";
    display: inline-block;
    with: XXpx;
    height: YYpx;
    background-image: path/to/image.svg /* or use of data-uri */
}

While signal word itsself is part of content, I can change the icon for better representation

...
Translate
Community Expert ,
Sep 05, 2024 Sep 05, 2024

Hi,

Tables should work well. You can set left and right indentation as you like.

Additionally you could put your icon into column 1 and the signal word and the text into column 2. Then you would not have this space between the signal word and the text.

Best regards, Winfried

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 05, 2024 Sep 05, 2024

Regarding the HTML5 output, you can apply a border in the styling like this:

FrameMakerdk_0-1725605138749.png

This will give you an output like this:

FrameMakerdk_1-1725605181554.png

I have not made a complete setup with "icons and stuff", but this is how you can make the html5 output work. If you want something similar like an option in pdf output, I would suggest using conditions.


Bjørn Smalbro - FrameMaker.dk
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2024 Sep 09, 2024

I think Bjorn has given you the direct answer. 

Andreas shows you how you can work it with tables, but I suspect that (like me) you would prefer to stay away from using tables for this.

A third option: I like to use paragraphs with a prefix (FontAwesome) for my warnings, notes, and cautions, and use CSS to get as close to Andreas' look using CSS.

Not exactly the same look, but cleaner under the hood and across varied browsers and screen resolutions.

 

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 09, 2024 Sep 09, 2024

Thanks Matt, I really like this as a preferred option and it's what I did when using Madcap Flare. The inability to use an image in a prefix in the .css is a real sticking point though. It was as easy as this in Flare

p.Warning
{
background-repeat: no-repeat;
height: 60px;
font-weight: bold;
margin-bottom: 6pt;
page-break-inside: avoid;
background-position: 0% 0%;
font-size: 16pt;
margin-top: 4pt;
margin-bottom: 4pt;
background-image: url('../Images/03000006.png');
padding-left: 60px;
}

Also for warnings I think we are going to have to tailor the image used to match the warning type so that's annoying.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2024 Sep 10, 2024

You can add that same code to your base CSS in the publish settings in less than 5 minutes.

Just export the CSS, modify, and import it back in.

MattTechCommTools_0-1725975240161.png

 

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2024 Sep 10, 2024

as for tailoring the image used, create p.warning, p.warningx, p.warningy, etc.

Just spec each to use a different image or character.

I've had better luck with vectors, so I use text prefixes with special fonts instead.

 

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 05, 2024 Sep 05, 2024

Hi ArmadilloC,

unfortunately I don't have any ideas how to build warnings without tables. Thats why I use tables. With some styling in FM and the CSS it's possible:

In FM I use tables with one col and two rows and table styles to control the styling of warning hints:

andreas_5547_0-1725604696400.png

You can set the table position to centered. Margins left and right depend on the table width.

andreas_5547_1-1725604729190.png

In HTML output, I added some custom CSS to control the positioning of the tables:

andreas_5547_2-1725605185287.png

andreas_5547_3-1725605212023.png

Reduce the width from 100% (e. g. 80%)

add for table "margin: 0 auto;" (Shorthand for: margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto:)

The keyword auto means that the browser calculates the remaining space. Result: Table is centered in parent container.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 08, 2024 Sep 08, 2024

Thanks Andreas, I think that code is the key to my problems. Looks like it's back to tables.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2024 Sep 09, 2024

@andreas_5547 Have you looked at using a CSS prefix to create an icon that's a vector/font using FontAwesome?
https://techcommtools.com/fm-html5-output-prefix/

 

 

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 23, 2024 Sep 23, 2024
LATEST

Hi Matt,

sorry for my late feedback. Now I'm back from vacation.

Thank you very much for your tip with the pseudo elements. I will try to use a pseudo element "::before" for the class of my signal words in warning hints like this:

p.SafetyHint__SignalWord::before {
    content: "";
    display: inline-block;
    with: XXpx;
    height: YYpx;
    background-image: path/to/image.svg /* or use of data-uri */
}

While signal word itsself is part of content, I can change the icon for better representation.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 06, 2024 Sep 06, 2024

I have been playing around with FM's builtin css editor and got this. The warning icon + text reside in an anchored frame set to below current line with a forced return. Maybe it's too cumbersome and the table solution is better...

FrameMakerdk_0-1725642349820.pngFrameMakerdk_1-1725642393973.png

FrameMakerdk_2-1725642421467.png

 


Bjørn Smalbro - FrameMaker.dk
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 08, 2024 Sep 08, 2024

Thanks for trying Bjorn. Yes, I think tables might be the logical way.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 08, 2024 Sep 08, 2024

Here is a sample file with a number of variations using reference page graphics, character styles, and paragraph styles. Let me know if you have any questions.

 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 08, 2024 Sep 08, 2024

Thanks Dave, but I don't think the system I'm on will allow random downloads from the internet.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2024 Sep 09, 2024

If you can recieve email attachments, message me by clicking on my name and give me your email address.

Here is a screen capture of most of the examples. The first two are automatically formatted with a single paragraph style (other than the content of the message); the last three are automatically formatted with a table style. 

image.png

David Creamer: Community Expert (ACI and ACE 1995-2023)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 09, 2024 Sep 09, 2024

Hi Dave,

great idea to use reference page objects as frames above/below in the paragraph styles. But is there an option to export these reference page objects to html? If yes: How to?

Current export result:

andreas_5547_0-1725872284699.png

My first idea was to add some custom CSS to add the missing objects (as html pseudo elements for the particular classes). But I'll be honest: that would be pretty cumbersome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2024 Sep 09, 2024

@andreas_5547 In order to have FrameMaker use graphics on the reference pages for HTML5 output, you  will need to tell it to do so. In the publish settings, you will have to click this box:

FrameMakerdk_0-1725876251592.png

this will pick up the objects on the reference pages as well.

 


Bjørn Smalbro - FrameMaker.dk
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines