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

How do I change Caution to red text?

Community Beginner ,
Sep 03, 2014 Sep 03, 2014

Copy link to clipboard

Copied

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

TOPICS
Structured

Views

1.2K

Translate

Translate

Report

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

Advisor , Sep 04, 2014 Sep 04, 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

...

Votes

Translate

Translate
Mentor ,
Sep 04, 2014 Sep 04, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
New Here ,
Sep 04, 2014 Sep 04, 2014

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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 Beginner ,
Sep 04, 2014 Sep 04, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Advisor ,
Sep 04, 2014 Sep 04, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Advisor ,
Sep 04, 2014 Sep 04, 2014

Copy link to clipboard

Copied

Hi Robert...

All formatting is controlled by the structure application template (which contains the associated EDD), as noted by Engineer/techwriter (above). You'd need to identify the structure app that you're using, then locate the associated template, then dig into the field that make up that template, make the necessary adjustment, and open your XML file again.

An easy way to identify the structure application is to use the StructureTools > Set Structured Application command after opening an XML file. The default name is the app that's currently in use. For DITA, there are many apps (it doesn't have to be that way, but that's the default way Adobe has set things up), so you may have to update many apps for your change to affect all "notes" of the given type.

In order to make the note color change only for "caution" notes, you'll need to create a context rule in the underlying EDD. You'll need to locate the EDD (or mod.edd) that contains the note element definition, then add a context rule that says "if note/@type = 'caution' make this element red". There are a number of ways to do this. The EDD context rule can assign the color directly, or it can apply a paragraph style to the element that assigned the color (of course, you'd need to add the new para style to the template for that to work). After updating the EDD, you'll need to locate the container of that EDD inset (which may be nested in another file which is nested in the main EDD). Update all of the insets, THEN remember to import the main EDD into the associated template (if you don't do this, your changes will not have any effect). You may need to do this EDD inset updating and importing into other DITA app templates as well, if you make use of multiple DITA topic types.

I always recommend that people clone the default apps and create your own apps before making any changes. This allows you to keep the default apps pristine and unmodified so you can test with them while making your modifications. You *will* break things (everyone does), and if you don't have something unmodified to test with you may be in trouble.

Yeah .. this is a lot of work to change the color of caution notes to red.

My preference is to use a single app for all DITA topic types. This can be done using the "ditabase" app. This is how the apps that ship with DITA-FMx are set up (DITA-FMx is a plugin that I develop and sell). Also, while nested inset EDDs do mirror the official DITA DTDs more accurately, they are a horrible user experience to maintain. One app with minimal insets is best (IMHO). If you want to try something a bit easier to use, you may want to check out DITA-FMx ..

     http://leximation.com/dita-fmx

Even if you don't buy it you may find that the structure apps are easier to manage. You can use them with default FM after minor adjustments.

Cheers,

Scott Prentice

Leximation, Inc.

www.leximation.com

Votes

Translate

Translate

Report

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 Beginner ,
Sep 04, 2014 Sep 04, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Advisor ,
Sep 04, 2014 Sep 04, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
New Here ,
May 26, 2020 May 26, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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
Advisor ,
Sep 04, 2014 Sep 04, 2014

Copy link to clipboard

Copied

Robert...

The EDDs won't update automatically. You have to open each "container" EDD and save it. The auto-update of an inset won't ripple through nested insets. After that you have to open each root EDD and import that into the appropriate template.

When you say "how to edit the commonElements file" .. I'm assuming that you know that it's a regular (structured) FM file that you can just open in FM and edit. You're looking for someone to tell you the actual syntax and location for the context rule to add to that file? Sorry, but I'm not going to sign up for that right now .. it's not all that hard, but it's a lot to explain. You should probably do some testing and experimentation on a simple (non-inset-based) EDD and structure app, so you understand how EDDs, element definitions, and context rules work. On this page are the Structure Application Developer's Guide and Reference PDFs ..

     http://www.adobe.com/devnet/framemaker.html

About half way down in the "Structure Application Development" section. Play with this stuff for a bit and it'll start to make sense.

Cheers,

…scott

Votes

Translate

Translate

Report

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
New Here ,
Sep 05, 2014 Sep 05, 2014

Copy link to clipboard

Copied

Hi

To change color to red for the Note prefix text (Concept topics):

1. Go to app > technicalContent > template

2. Open concept.template (first make copy of original)

3. Press ctrl + D to open character designer

4. In the Character Tag drop down, select note.type

5. Change color to red.
6. Save, you may have to save to some other directory than C: then move copy to the template folder and replace.

For other topics types, same procedure but different topic type.

Best regards

Votes

Translate

Translate

Report

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
Advisor ,
Sep 05, 2014 Sep 05, 2014

Copy link to clipboard

Copied

Note that this changes the color for *all* notes. Robert wanted to change it just for "caution" notes. That requires some EDD work.

…scott

Votes

Translate

Translate

Report

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 Beginner ,
Sep 05, 2014 Sep 05, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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