How to tag content to enable specific application of CSS formatting
One of the challenges that often pops up with a Web application development effort is the need to make a specific piece of information appear a certain way in the browser. In the print document, however, such formatting would not make sense and possibly should not even be visible.
In the case of a Word or Word-compatible source file being published as a Rich Hypertext rendition, Hyper.Net provides you with a quick solution that allows authors to tag text in the source file with a paragraph or character style. Within your Word template you can applying the style easy by creating a button on the Word toolbar that applies the style automatically.
You can then specify that all occurrences of the style should be tagged in the resulting HTML in such a way that you can control the appearance of the marked text using a cascading style sheet.
To set this up, follow these steps:
| |
|
|
|
Step
|
|
1
|
Identify an existing style in use in the Word document or create a new one that is or will be used to mark text. For example, let's say we create a character style named PartNumber. In Word, this style inherits the default style, which means it doesn't look any different than other text in the document when the document is printed.
|
|
2
|
Open the Hyper.Net Administration console and start the Schema Editor. Click on the Action icon next to an existing schema and select Modify this Schema (or create a new schema).
|
| |
|
|
3
|
In the left navigator of the schema editor, select Topic Manipulation and Content Classifications. The following screen will appear:
|
|
4
|
Click on Add. The following dialog will appear:
|
|
5
|
Enter the Word style name you wish to tag and the name of the class ID you would like to publish for this text. Click on Add.
|
Hyper.Net processes this content classification as follows:
| |
· |
Hyper.Net processes the Rich Text rendition of the document and breaks it into one or more topics in a hierarchy
|
| |
· |
Within each topic, Hyper.Net identifies all text marked with the defined style PartNumber
|
| |
· |
Each occurrence is published as a SPAN having the designated class ID partnum. Example of the result of the above definition:
|
<SPAN class=partnum>marked-text-from-Word-doc</SPAN>
You are now able to define appearances and behaviors for this text within your cascading style sheet, while the text in the source document remains unchanged.