> MadBlog > Article

Tips and Tricks: Applying Formatting to Conditions in Outputs

Published on: December 20, 2011

Table of contents
MadCap Software Logo
blog image

Users have asked if there is a way to style a condition so that it appears a certain way in Flare's outputs.  Here is a little trick to accomplish just that.

The first step is to make sure that you have a condition applied to an element in your topic.  In this sample, we'll use the "Default" Conditonal File Set and the PrintOnly Condition in it. Then follow these steps:

  1. Create an "Empty" Flare Project (Using the Empty Template Provided)
  2. Choose WebHelp as the output type
  3. Open the only topic in the editor
  4. Select the text or paragraph that you want to apply the Conditional Tag to.
  5. Go to Format > Condtions... and select "PrintOnly"
  6. Click "Ok" and save
  7. In the Content Explorer, Open the Stylesheets folder
  8. Right-click on the Styles.css and open with Notepad
  9. Copy the CSS code from below and paste it at the end of the stylesheet
  10. Save and close Notepad
  11. Build the WebHelp output and view the results. You should see the text or paragraph that you selected with a grey background.

CSS code:

For WebHelp:

[MadCap\:conditions*="Default.PrintOnly"]
     {
          background-color: #C0C0C0;
     }

For HTML5 Output:

[data-mc-conditions*="Default.PrintOnly"]
     {
          background-color: #C0C0C0;
     }

For both outputs:

[MadCap\:conditions*="Default.PrintOnly"], [data-mc-conditions*="Default.PrintOnly"]
     {
          background-color: #C0C0C0;
     }

Remember, if you apply this to a condition that is set to be removed in the Target, it will not appear at all in the output.

Note: The CSS to achieve this is not yet supported in our internal CSS editor, so if you want to make a change, edit, or create a more, you will have to use notepad or another CSS editor.

Posted in: MadCap Flare, Tech Comm, Tips & Tricks


Jose Sermeno

With over 10 years of experience in the software industry, Mr. Sermeno brings a wealth of knowledge and expertise to the product evangelist team, helping introduce new users to everything MadCap Software. In his spare time, Jose is the Project Director for San Diego City Robotics, the San Diego community college systems robotics program, and enjoys working in software design and open source hardware development. Prior to joining MadCap in late 2010, Jose ran a Drupal development shop, and was an application manager for Temple University Health System.

Try for Free

See it in your own workflow. Start a free trial and build your first project today.

lightbulb icon

Have a suggestion for a blog article? Submit it here