When you publish to an HTML-based output, Paligo automatically adds class names or IDs to many of the HTML elements in the output. This is so that they can be styled using CSS.
But you can also add your own class names if needed. This is especially useful if you want some elements to be styled differently. For example, you can add it to:
-
a
table
element to create different-looking tables (such as information tables and parameter definition tables). -
a
mediaobject
element if you want different types of images to behave differently.
There are two ways to add class names:
-
Add a
role
attribute and its value becomes the class name, see below. -
Use taxonomies, see Use Taxonomies as HTML Classes and Custom Class Names for Images - Taxonomy Tag.
Note
You do not add class names directly to the HTML. Instead, you add class names to the Paligo XML that becomes the HTML when you publish. Paligo then includes your class name when it generates the HTML output.
Warning
Only add your own class names if there is no other way. Otherwise, you might end up with unstructured content as every topic can have unique roles.
To style elements with your own class name:
-
Select the topic or component in the Content Manager to open it in the Editor.
-
Select the element that you want to style in the Element Structure Menu.
For example, to style a table differently from other tables, select its
table
element. -
Add the
role
attribute in Element Attributes Panel and enter theclass name
as the value.Note
Use a role class name that does not clash with any of the other names already used by Paligo, see Role Attribute Values.
We recommend that you create unique names that are easy to understand and are specific to your organization, for example, "acme-leadtable". This will help to avoid clashes with existing or future class names.
-
Select Save.
-
Repeat this process for any other elements that you want to style differently.
-
Publish your content to generate an output with your custom class name(s) included.
When you publish, Paligo will add the class name to the HTML element. You can then use CSS to style that class, see Style with CSS.
Comments
0 comments
Article is closed for comments.