This post is a result of two separate questions/requests from customers.  One customer was interested in applying conditions to the text in her source documents using styles and the other was wondering if there was a way to “color code” conditions like you can in other tools, such as Framemaker or RoboHelp.

Doc-To-Help has two pre-defined styles that control conditional text: C1H Online and C1H Manual.  Anything you apply C1H Online to will only appear in online outputs (basically anything but a manual).  Anything you apply a C1H Manual style to will only appear in Manual targets.

If you want to create a style that works for a specific platform, target, or attribute (you want one that’s NetHelp specific or Mobile specific, whatever the case may be), here’s what you do.  I created a Word version of this project and an XML version of this project.  Both projects are zipped and you can download them here.  If you’re interested in setting up your projects with the same style names and settings that I did, all that is in there.  You can copy everything from the templates (Word) or style sheets (XML) and the Doc-To-Help projects I created.

For Word documents:

  1. Go to the Source Template dropdown and choose Edit Template.  Your template will open in Word.
  2. Create a new style (called C1H NetHelp) in the template and base it off of C1H Conditional.  Then set the formatting in the style to the color of your choice.

    Settings for Word Style C1H NetHelp

  3. Copy the style to your Target Templates using the Organizer in Word (see UsingTheOrganizer.docx in the sample project).
  4. In Doc-To-Help, go to the Project tab and click the Project Styles button.
  5. In the Add New Style dropdown, select Character Style.  A new style will be created and you can choose the name of the style from a dropdown, so choose C1H NetHelp and base it off the C1H Conditional style, not the style defaults.
  6. From there, you can modify the Platform, Target, and Attribute, just like you would in the Conditional Text dialog using the button in the Doc-To-Help toolbar.  Any text you apply that style to in the Word document will follow those rules.  I color coded my conditions so that Mobile is orange, NetHelp is pink, and HTML Help is green.  I also added the styles to the Quick Style Gallery in Word.

The outputs will reflect the conditions you applied in the documents.  Here’s what the Mobile output looks like in that sample (identifies the user as a Mobile User and instructs them to “Tap” instead of “Click” the Getting Started topic).

For XHTML documents in Doc-To-Help’s built-in editor:

The last three steps in Doc-To-Help are the same (creating the styles in Project Styles, modifying the Platform, Target, or Attribute).  Creating and applying the styles are slightly different and don’t involve using the Organizer.  Any style that you create from a document in the built-in editor is automatically copied to your Target style sheet, so the editor saves you that extra step.

  1. Double-click any .xml file in your project to open it up in the editor.
  2. In the Editor tab, click the Style List button.
  3. In the Style List, click the Add New Style button and create the Character styles (C1HNetHelp, C1HMobile, C1HHTMLHelp).  Remember that you need to specify that the style is a Character style in the dropdown (Paragraph style is the default) and that styles created in the editor cannot have dashes or spaces.
  4. From there, highlight text and apply styles as you normally would.  The styles I created also got added to the Quick Style Gallery in the Editor tab.

Try it out and let us know your results!

Tags: , , , , ,