Skip to main content
Skip table of contents

Define Conditional Content

Define content that only appears under certain conditions when publishing with Scroll apps.

Applying Confluence page labels and the Scroll Conditional Content macro lets you define which which pages or sections of pages in your document will be included in which variant.

To be able to define conditional content with Confluence page labels and the Scroll Conditional Content macro, you need to first create one or more variants of your document.

Define Conditional Content at a Page Level

Using Confluence page labels, you can define which pages of your document are available in one or more variants.

When you’re viewing a page in Confluence, you can add a page label by clicking the label icon at the bottom right corner of the page.

If you need to add labels to multiple pages, we recommend you use the label edit option in the Variants Manager. When you click New variant or Edit on an existing variant, you can switch from a dynamic page tree preview to a label edit mode. This mode allows you to add multiple labels at once without having to switch views.

Please note: Managing labels from the Variants dialog is only available if you have extended Scroll Documents with Variants for Scroll Document.

Step 1: Navigate to the Variants Manager

  1. Navigate to the Document Library of the space where you have created your Scroll Documents.

  2. Click on the document card to navigate to the Document Manager.

  3. Click Manage.

  4. Select Variants.

Step 2: Add Confluence page labels from the Variants dialog

  1. Click New variant or the pen icon in the variants list to edit an existing variant

  2. In the Variant details dialog, click the cog icon in the top right

  3. Click the Edit page labels toggle to switch to the label edit mode:

  4. For each page you want to add a label to, click Add label under the page title

  5. Type your label and hit enter or click (tick)

Scroll down the page tree to continue adding labels to the pages in your document. Use the version picker at the top to switch to the page tree of a different version.

To add or remove labels in bulk for all child pages, from the label field of a parent page hold down the Alt/Option key and click (error) or (tick)

Labels are applied to the pages right away and are visible in the page view mode just like any other Confluence page label. Page labels are inherited when you save a version.

To edit page labels, you can alternate between the Confluence page view and the Variants details dialog and use both options interchangeably.

How can I add a label to a space overview page?

Space overview pages don’t include the label tag icon at the bottom of the page.

To add a label on a space overview page, use the Edit page labels option when creating or editing a variant. Alternatively, open the page in the Confluence editor and click ‘Add labels’ from the ••• actions menu.

Define conditional content at a paragraph level

Using the Scroll Conditional Content macro, you can define sections of content within a page to be available in specific variants.

This is useful when you have content on a page that is applicable to only a particular variant. For example, an additional tip or instruction targeted to admins only.

To define conditional content at a paragraph level:

  1. Navigate to a page in your document page tree.

  2. Click Edit (pencil icon) on the top right of the page. The Confluence editor will open.

  3. Place your cursor at the position where you would like to add the conditional content. Type '/' (slash command) and search for Scroll Conditional Content macro. Press enter.

  4. In the macro editor, add one or more labels that you have defined in the variant rule, e.g. developers.


    The Variant preview below the label field will confirm which variants the content of the macro will be valid for.

  5. When ready, click Insert.

  6. Add your content to the body of the macro.

  7. Click Publish.

The content in the macro will now only be included when you select the relevant variant for publishing.

You can add multiple conditional content macros to a single page that display content for different variants.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.