Documentation Center

Example scenario: Setting conditions and configuring custom output

This scenario describes tagging data with conditions and configuring two publication output formats to include and exclude the conditional data.

Scenario: Suppose you have topics that are to be published to both CHM and PDF. You have applied conditions so that specific information is to be included in the CHM file but not in the PDF file. For instance, you have included a flowchart as an imagemap in a topic. The imagemap functions in CHM files but does not in a PDF file so you want to:

  • Include the image in both output formats.
  • Include the directive to "Click on any of the boxes in the graphic below to display additional information" only in the CHM output but not in the PDF.
  • Exclude the <area> tags associated with the imagemap from being published to the PDF.
  • Include the additional information in the topics associated with the imagemap in both output formats, so they can be viewed independently as separate topics.
To do this, you must do the following:
  1. Create a condition to tag data to differentiate when publishing to CHM and PDF.

    For example, create the condition output-format with two values: xhtml and print.

  2. Tag the data in your topics appropriately with the condition (ishcondition attribute) to identify data that is to be published to CHM but not when publishing to PDF.
  3. Create a map that includes all the topics.
  4. Create two publications; to be used when publishing CHM and PDF, reference the same map in each publication.

The following is an example of the data and tags relating to the imagemap as described in this scenario. Tagging the data appropriately with the ishcondition identifies the data that is to be published when creating the CHM but not to be published when creating the PDF.

Note the ishcondition="output-format=xhtml" that identifies the data to be included when publishing for xhtml output only. The publishing process is illustrated in the XML below.

<p> 
					 ishcondition="output-format=xhtml" Click on the boxes in the illustration to display additional information. <imagemap>
<image placement="inline" href="GUID-C4F25C67-6B88-4C72-930A-21BDB4E70F8A" id="IMAGE_66A820048C7543BAAB78669B68CA44F3" /> </p>
				  

The PDF publish process should eliminate anything tagged with the ishcondition="output-format=xhtml" and should publish the following using the ishcondition output-format=print:

 <p> 
					 ishcondition="output-format=print"The user interaction when publishing involves the following, shown in the diagram below. 
<image placement="inline" href="GUID-C4F25C67-6B88-4C72-930A-21BDB4E70F8A" id="IMAGE_66A820048C7543BAAB78669B68CA44F3" /> </p> 
				 

Create the publication for PDF output as follows:

  1. Create a publication for output to PDF.
  2. Open the publication in Publication Manager then click on the Output tab.
  3. Click Add and select a PDF output format.
  4. Click Next.
  5. Click on the Conditions tab.
  6. Click Modify...
  7. From the resulting Select Conditions window, locate the output-format condition.
  8. Click to check the box for Print.

    This tells the publish engine to look for the output-format attribute and only include the data if the value is Print. In this case, it will eliminate data with output-format that has a value of xhtml.

  9. Click OK.
Create the publication for the CHM output as follows:
  1. Create a publication for output to CHM (or xhtml).
  2. Open the publication in Publication Manager then click on the Output tab.
  3. Click Add and select the CHM output format.
  4. Click Next.
  5. Follow the steps above for the Conditions tab but set the output-format condition as xhml.
  6. Share the baseline of the PDF-output publication.
    • Right-click on the publication for CHM output then select Properties.
    • Click the Version tab.
    • Click the ellipsis button to the right of the Baseline field.
    • Select the baseline of the PDF publication.
    • Click OK.