How to display a specific element label?

Post here questions and problems related to editing and publishing DITA content.
almeim
Posts: 9
Joined: Mon Sep 12, 2022 8:46 pm

How to display a specific element label?

Post by almeim »

How do you display only the prereq element's label in the webhelp output. The parameter "args.gen.task.lbl" displays ALL the task labels. I only want the prereq task label to display.
alin
Site Admin
Posts: 229
Joined: Thu Dec 24, 2009 11:21 am

Re: How to display a specific element label?

Post by alin »

Hello,

You can achieve this using the following CSS rule:

Code: Select all

.prereq::before {
  content: "Before you begin";
  display: block;
  font-weight: bold;
  font-size: 1.2em;
  margin-top: 1em;
}
You can find more details about how to use CSS styling to customize the output in our User Guide.

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
almeim
Posts: 9
Joined: Mon Sep 12, 2022 8:46 pm

Re: How to display a specific element label?

Post by almeim »

Thanks, it worked! I want to do this for different languages. Would I have to manually add different css files depending on my output or is there an easier way to do it?
alin
Site Admin
Posts: 229
Joined: Thu Dec 24, 2009 11:21 am

Re: How to display a specific element label?

Post by alin »

Hello,

You can place all your localized strings in a single CSS file by specifying several CSS rules using the :lang() pseudo class.
For example:

Code: Select all

.prereq::before {
  content: "Before you begin";
  display: block;
  font-weight: bold;
  font-size: 1.2em;
  margin-top: 1em;
}

.prereq:lang(de-DE)::before {
  content: "Bevor Sie beginnen";
}

.prereq:lang(fr-FR)::before {
  content: "Avant que tu commences";
}
Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply