Web documents often contain elements that either don't translate well or are not necessary in printed documents. For example, they often feature a sidebar of links that help the user navigate the web site. However, such a sidebar would hardly make sense on a printed page. On the flip-side, there may be information that you want printed in your Highwire document, but hidden in the web page.
Highwire's <ctignore> and <ctadd> tags were created for such purposes. They allow you to hide sections of a web document from Highwire, or to hide sections of your document from web browsers.
Note: Alternatively, you could detect a client's user agent from your web application and vary your content based on whether or not the client is Highwire (see "Detecting Highwire User Agent").
To hide a section from Highwire
If there is a section of your document that you want Highwire to ignore, you can specify that Highwire should ignore it using the following steps.
- Open your HTML/XHTML document in an HTML or text editor, such as Notepad.
- Immediately before the start of the document section you wish to hide from Highwire, insert the following tag.
- Immediately after the end of the document section you wish to hide from Highwire, insert the following tag.
- Save your changes.
<!-- <ctignore> -->
<!-- </ctignore> -->
For example, if you had an image tag that contained an advertisement you wanted only to appear on the web page, your document might look like this:
Example 3.3 Hiding a document section from Highwire
<p>This is the last paragraph in the first section.</p>
<!-- <ctignore> -->
<img src="ad.jpeg" alt="an advertisement that should only appear in a web browser" />
<!-- </ctignore> -->
<h2>Start of next section</h2>
To hide a section from your browser, but not Highwire
If there is a section of your document that you want Highwire to render, but don't want to be visible in a web page, you can hide it from your web browser using the following steps.
- Open your HTML/XHTML document in an HTML or text editor, such as Notepad.
- Immediately before the start of the document section you wish to hide from web browsers, insert the following tag.
- Immediately after the end of the document section you wish to hide from web browsers, insert the following tag.
- Save your changes.
<!-- <ctadd>
Note that we don't close the comment. This is because the comment is what instructs the web browser to ignore the section. The<ctadd>tag instructs Highwire to go ahead and include the contents inside of it.
</ctadd> -->
For example, if you had some text that you wanted to appear only in the Highwire document, your web document might look like this:
Example 3.4 Hiding a document section from a browser
<p>This is the last paragraph in the first section.</p>
<!-- <ctadd>
<p>This text <em>shouldn't</em> appear in your web browser. It will only appear when you convert this document to PDF with Highwire.</p>
</ctadd> -->
<h2>Start of next section</h2>
CORDA