Skip to main content
1-Visitor
June 29, 2015
Solved

How to apply background color for some tags which having attribute in arbortext editor

  • June 29, 2015
  • 7 replies
  • 3061 views

Hi developers,

I want to apply background color for particular tag with attribute (<dl ishcondition="output-type=content-in-pdf-only">). How can i achieve this using styler files?

Thanks in advance

Roopesh N

Best answer by ReicheltBert

Hi Roopesh,

you can do this in Styler by using the "condition" dialog.

  1. In Styler, select the particular tag/element
  2. In the top menu select "Insert" > "condition" (or simply press F11)
    The "condition" dialog pops up.
  3. Click on "New Attribute Test"
    The "Attribute test" dialog pops up.
  4. Insert your individual attribute check. You can access a specific help page from the "Attribute Test" dialog, if you have problems to do this.
  5. Once you're done, click "ok" in the "Attribute Test" dialog, and again "ok" in the "condition" dialog.
    The new condition appears in the list of elements in styler, nested in the particular tag/element
  6. Select the condition.

You can now style the condition in any way you want. The style will only be applied to elements with the condition you just set up. (Condition check = true)

The background color can be set in the very first tab "font". There you find a setting called "shading".

7 replies

1-Visitor
July 1, 2015

Hi Roopesh,

you can do this in Styler by using the "condition" dialog.

  1. In Styler, select the particular tag/element
  2. In the top menu select "Insert" > "condition" (or simply press F11)
    The "condition" dialog pops up.
  3. Click on "New Attribute Test"
    The "Attribute test" dialog pops up.
  4. Insert your individual attribute check. You can access a specific help page from the "Attribute Test" dialog, if you have problems to do this.
  5. Once you're done, click "ok" in the "Attribute Test" dialog, and again "ok" in the "condition" dialog.
    The new condition appears in the list of elements in styler, nested in the particular tag/element
  6. Select the condition.

You can now style the condition in any way you want. The style will only be applied to elements with the condition you just set up. (Condition check = true)

The background color can be set in the very first tab "font". There you find a setting called "shading".

rnavath1-VisitorAuthor
1-Visitor
July 1, 2015

Hi Reichelt Bert,

Thank you for your help. I tried with the above steps color is reflecting, but when i reload the xml files color is not appearing.

It is appearing oly if i click edit ditabase.style file(arbortext editor-->styler-->Edit stylesheet).

Could you please suggest me what is wrong i am doing.

    <Conditions>

    <Condition>

    <Tests logic="and">

    <AttributeTest attributeName="ishcondition" testValue="#ANY"/></Tests>

    <BaseProperties propertySetReferences="ishcondition">

    <GeneratedText>

    <AddBefore>

    <_sfe:BeforeOrAfterText>

    <_ufe:ishcondition-beginmarkup>

    <_gte:AttributeContent attr="ishcondition" occur="1" scope="condition"

    ></_gte:AttributeContent>

    </_ufe:ishcondition-beginmarkup>

    </_sfe:BeforeOrAfterText>

    </AddBefore>

    </GeneratedText>

    </BaseProperties>

    <OutputProperties output="editor">

    <Highlight color="#0000FF"/></OutputProperties>

    </Condition>

Thanks in advance

Roopesh

1-Visitor
July 6, 2015

Well, If the colors show up, when you edit ditabase.style, then it means you made the settings in styler right! Good Job, so far!

So, the problem is something else. Probably it has something to do with the general settings in Arbortext. When you open a dita file, on default Arbortext will style the xml with the settings of ditabase.style. If you made the settings in another style file, then they won't show up. So either you have to change the ditabase file OR you have to change Arbortext defaullt settings to no use ditabase.style, but the style file you made the settings.

Unfortuanetely I can't tell how to do this, since I never had to change the default settings of our Arbortext.

rnavath1-VisitorAuthor
1-Visitor
July 7, 2015

Thank you all for your support. Finally i found a solution for this in FOSI stylesheet. Now i am able to apply color based on attribute.

Thanks

Roopesh N

12-Amethyst
July 7, 2015

Could let the community know what was the best advice that helped you resolve this issue, by marking on of the answers with a Correct Answer?