How to Define Snippets, Variables, and Conditional Content

How to Define Snippets, Variables, and Conditional Content

Reusing content across topics and formats is the cornerstone of ClickHelp’s efficiency. This guide walks you through establishing a reusable content layer using Single source of truth concepts, snippets, variables, and conditional content. You will learn how to define reusable blocks, reference them in multiple topics, and ensure consistency across your portal and downstream outputs like PDFs and API responses.

Planning your reuse strategy

Before creating wearables of content, outline your reusable components. Think in terms of: snippets (small reusable blocks such as cautions or step templates), variables (brand terms, product names, and versions), and conditions (audience, language, or edition-based content). This planning reduces drift by ensuring consistent phrasing and structure when you publish across formats.

Defining snippets

  1. Open the Snippets library in your project. Click New Snippet.
  2. Enter a Name and add the Content. Use placeholders for variables you will replace per edition, such as {{ProductName}}.
  3. Save the snippet and insert it into topics via the Insert Snippet command. This ensures any future update to the snippet propagates to all linked topics.

What you’ve accomplished: a library of reusable blocks to speed up authoring and ensure consistent messaging. What comes next: reuse snippets in starter topics and create variables and conditions to tailor content by audience or edition.

Creating variables

  1. In the project, choose Variables and click New Variable.
  2. Define a Name and a Value or a dynamic source. Use variables like {{ProductName}}, {{PortalURL}}, or {{SupportEmail}}.
  3. Reference variables using the mustache-like syntax within topics. This ensures replacements occur uniformly when you publish.

What you’ve accomplished: central term management that updates across all topics. What comes next: combine variables with conditional content to produce audience-specific outputs.

Setting up conditional content

  1. Within a topic, select text blocks and apply a Condition. Choose the audience, edition, or output criteria that should show or hide the block.
  2. Test the conditions by previewing the topic in different modes (public vs. internal, different languages or editions).
  3. Publish a sample page and verify the conditional blocks render correctly for the chosen audience.

What you’ve accomplished: content tailored to readers without duplicating topics. What comes next: link these reusable components to a broader workflow for automated publishing across channels.

Best practices and governance

  • Document naming conventions for snippets and variables so teammates can find and reuse components quickly.
  • Regularly audit the llms.txt mapping and ensure all AI tooling references align with current content blocks.
  • Pair reuse with analytics to measure how readers interact with conditional blocks and adjusted content for different audiences.

Cross-links: See Topic 1 for the high-level model and Topic 2 for onboarding steps to import content first. Also, explore Topic 5 for publishing and testing AI search with your configured reuse strategy.

What to do next

  1. Publish your branded portal and test AI search
  2. Review the concept overview
Note: When you reuse content across portals, ensure licensing and attribution requirements for external sources are respected in your policies.