Skip to main content
Participating Frequently
September 3, 2014
Answered

How do I change Caution to red text?

  • September 3, 2014
  • 5 replies
  • 1483 views

I am writing a DITA document. I am trying to change the color of the Note element choice "caution" text from black, which is the default, to red. I've tried changing things in the commonelements.mod, but with no luck. I know you can do this. I am not a programmer, so it would be helpful to have it explained in a step-by-step manner.

Thanks

Robert

This topic has been closed for replies.
Correct answer Lynne A. Price

Robert,

1. If you are going to be editing EDDs, you should be familiar with the Structured Application Developer's Guide and corresponding Reference Manual. To find the latest versions, go to adobe.com, search for FrameMaker, click Get Help and Support and then follow the appropriate links in the list of online documents on the right.

2. Find the element definition for <note> in commonElements. In the text format rules, add the context rule:

  

    If context is: [type = "caution"]

          Default font properties:

               Color: Red

3. As shipped, the text insets in the DITA EDDs are set to update manually, not automatically. Unless you've changed the settings, you'll need to open each EDD you use and update its text insets. I don't remember whether if there are nested text insets you have to update each level separately.

4. Once the EDDs are updated, you'll need to import element definitions from the EDDs into the associated templates or any existing FrameMaker documents.

          --Lynne

5 replies

Participating Frequently
September 5, 2014

Hi all-

    If context is: [type = "caution"]

          Default font properties:

               Color: Red

is placed in the Prefix Rules section of the element container "note", only "caution" turns red. If it is placed in both the Prefix Rules and Text Rules, the entire paragraph turns red.

Cool.

Thanks for all your help. Well done.

Now to make it ripple throughout...

Robert

Participating Frequently
September 4, 2014

Hi all-

Thanks for the suggestions.

I had to learn the hard way where the templates are and how to point the structured apps to load them as the default. Nothing is obvious and there are a billion places to put things.

Scott is correct that you should clone everything and only work with the copies. However, restoring a previous version also works, provided that feature is turned on.

To answer Lynne's question:

I need to know how to edit commonElements.eddmod.fm to make cautions red. This is used as a text inset in most of the EDDs I use.

All the associated EDDs where commonElements.eddmod is imported as a text inset are set to update the inset automatically, so that problem is taken care of once I have commonElements.eddmod edited.

Anyone have any ideas?

Robert

Lynne A. PriceCorrect answer
Inspiring
September 4, 2014

Robert,

1. If you are going to be editing EDDs, you should be familiar with the Structured Application Developer's Guide and corresponding Reference Manual. To find the latest versions, go to adobe.com, search for FrameMaker, click Get Help and Support and then follow the appropriate links in the list of online documents on the right.

2. Find the element definition for <note> in commonElements. In the text format rules, add the context rule:

  

    If context is: [type = "caution"]

          Default font properties:

               Color: Red

3. As shipped, the text insets in the DITA EDDs are set to update manually, not automatically. Unless you've changed the settings, you'll need to open each EDD you use and update its text insets. I don't remember whether if there are nested text insets you have to update each level separately.

4. Once the EDDs are updated, you'll need to import element definitions from the EDDs into the associated templates or any existing FrameMaker documents.

          --Lynne

galano_with_ni
New Participant
May 26, 2020

Hi Lynne,

 

I found your answer to Robert when I was looking for an effecient solution that allows me to set the font color for <dt> (definition term) to Green or whatever. 

 

For the Text Format Rules, I have the following:

 

1. In all contexts.
        Use paragraph format: def.term
2. If context is: dlentry < dl[compact!=“yes”]
        2.1 If context is: {first} < dlentry {notfirst}
                Basic properties
                    Paragraph spacing
                        Space above: 8pt
                        Space below: 4pt
                Default font properties
                    Color: Green
            Else
               Basic properties
                   Paragraph spacing
                       Space below: 4pt
                Default font properties
                    Color: Green

 

I added the four lines in green under if/else conditions to force the font color be green. But it doesn't take effect after I importing the EDD to a test doc with <dt> for verification. 

 

Do you think I need to configure anything else in the \Structure\xml\DITA_1.3\app\base\edd folder? 

Many thanks!!

 

Respect, 

Galano

Participating Frequently
September 4, 2014

I think I need to be more specific...

When using the Note element, you can set the type of note, (e.g. caution, important, warning etc.) in the attributes. These are black by default.

I'm sure you can change the color of any of them through editing the XML. All the EDDs use the text inset commonelements.mod to import the note prefix and context rule settings.

Does anybody know what I need to change to make this happen?

Thanks in advance,

Robert

Inspiring
September 4, 2014

Robert,

    Are you familiar with FrameMaker EDDs? Like a DTD or schema, an EDD defines the elements and attributes available in a class of documents. In addition, an EDD can assign context-sensitive formatting to various elements, such as making cautions red. The DITA 1.2 EDDs are more complicated because they include reusable modules such as commonElements.eddmod.fm as text insets.

   It's not clear whether you are asking:

1) How to edit commonElements.eddmod.fm to make cautions red

2) How to incorporate the change to commonElements into the EDD you are using

3) How to determine which EDD you are using

4) How to get the changes in the updated EDD into your documents

   Let us know and we will likely be able to provide more help.

            --Lynne

Known Participant
September 4, 2014

Hi Robert,

The formatting for DITA documents in FrameMaker is controlled by templates found in the FrameMaker installation directory.

If you select StructureTools > Edit Global Application Definitions, the structapps document will open.

Here you can select the Structured view (tree view) and you will see all the different XMLApplication for DITA 1.2

You can open the tree for example DITA_1.2_concept and will you see a Template element that refers to $STRUCTDIR\xml\DITA_1_2\app\......

This is the means that the formatting for the DITA 1.2 concept is controlled by this template.

You can edit the DITA templates and you find them in the FrameMaker installation directory > Structure > XML > DITA 1.2 > app > technicalContent > template

Please note that if you transform your DITA files to a FM book for publishing that these are controlled by different templates.

Braniac
September 4, 2014

Robert,

Do you want it to be red in FM? If so, either the underlying template or the EDD would control the formatting. I am not too familiar with the inner workings of the DITA components in FM, so I can't point you to something specific... perhaps someone else with more DITA expertise can.

Russ