Insert Dynamic Content with Macros in the Knowledge Base

Knowledge Base contributors can insert dynamic content into their articles. This article demonstrates useful macros for the Knowledge Base and explains best practices for using their functionality.

Table of Contents

Overview 

Macros are visuals that dynamically organize your content and allow you to draw attention to aspects of your content that you want to have stand out to your readers. They are especially useful when you have a piece of information that is important for your readers but does not fit into the rest of your article. Additionally, macros provide additional functionality to your articles, enabling you to link pages, condense your content into accordion folders, insert page anchors, create and insert project timelines, and much more.  

Inserting Macros

  1. Create your new page.

  2. Select the "+" in the toolbar. 

  3. Select the macro you want to use from the drop-down menu. Alternatively, you can select View More at the bottom of the menu to see the full suite of macros. 

  4. Once you are in the suite of macros, you can browse through the different categories on the left or use the Search bar at the top.

Helpful Macros and Their Functions

The "Tip," "Info," "Note," and "Warning" Macros

The tip, info, note, and warning macros are useful ways to call out details that users should give special attention to. 

When creating any one of these macros, type the name of the macro in the Search bar of the “+” icon.  

Example 1

For a Note macro, enter "Note."

note macro search

Tip Macro 

The Tip macro is used when providing information that will enhance the reader's abilities. 

When creating macros, title the macro for what it is (e.g., title a tip macro "Tip"). This will help the reader understand the purpose of the information.

Info Macro

The Info macro is used when providing information that may be of interest to the reader but that is not necessary to understand. 

Confluence allows article writers to easily move the macros around the page by clicking and dragging.

Note Macro

The Note macro is used when providing information that is necessary for users to understand. 

Macros should only be used when providing information that should be represented separately from the rest of the article content. Avoid using macros to provide information that would easily fit in the regular content of your article.

Warning Macro

The Warning macro is used when you need to alert your readers to an exceedingly important detail. Warning macros are for cautionary messages and should be used only when the information being conveyed is urgent. 

Error Macro

The Error macro is used when providing the reader with critical information pertaining to the article. The information usually consists of consequences or a way to tell the readers something that could go wrong.

 

Tip: you can change an already inserted bar using Left-Click.

 The "Content by Label" Macro

The Content by Label macro is a way to use labels to automatically display links to related articles on our space. Insert this macro at the bottom of every page under the "Related Articles" heading. The Content by Label macro chooses articles to display based on the labels you set when creating articles. 

Inserting and Using the “Content By Label” Macro

  1. Scroll to the bottom of the page.

  2. Click on the area you wish to insert the macro.

  3. Click on the “+” icon and type “Content by Label” into the Search bar.

It should then bring you to an Edit Menu that looks like this:

edit content by label macro window

This Edit menu allows you to add Labels to the article, which means that any word that matches another article will be recommended in the macro. There are also different options that can be expanded upon below the Label Bar by clicking on the Show button, this includes:

  1. Sort By: You can sort how the labels relate to other articles, it can be by the title, by their creation date (newest to oldest), or the most recently modified version of the article.

  2. Maximum Number of Pages: You can set how many pages the “Content by Label” macro is, with the default being 15.

  3. List Title: This allows you to add a title to the macro.

  4. Excerpt Display: This changes how the excerpts are displayed for each page. You can use:

    1. None: Only shows the links to each article.

    2. Simple: Adds specific labels underneath each article.

    3. Rich: Makes the macro much more detailed, adding notes and information about each link.

The "Expand" Macro

The Expand macro is a great way to condense and categorize your content. If you have lists, bullet points, or section-specific information that you do not want to clutter your article, you can condense this into a clickable link that will display your content. For example, click the blue text below. 

  1. This is the Expand macro.

  2. You can create lists, insert photos, graphs, and visuals, or just put plain text.

  3. The amount of space you have to insert content into the Expand macro is unlimited.

Inserting and Using the Expand Macro

Go to the “+” icon and use Search bar to look for Expand. Click on it and it will be inserted into your article.  

Once the Expand macro is inserted into your article, you can begin typing your text, inserting photos, charts, visuals, or creating lists. 

The "Table of Contents" Macro 

The Table of Contents macro allows you to link different parts of your article to the top of the page. This allows the reader to quickly access the information they need (by selecting the link) instead of having to scroll through the whole article to find what they need. For example, selecting your topic of interest at the top of this article allows you quickly navigate to the information you want to see. You are not required to use the Table of Contents macro, but it can be a great way to streamline your reader's experience. The Table of Contents macro should be used for long articles or articles that require a lot of scrolling.  

The Table of Contents macro chooses the links to display solely based on the headings and heading numbers. You only have to set up the table of contents macro to choose the correct headings (see below). 

Using the "Table of Contents" Macro

Scroll down to the section of the macro setting window displayed below.

  1. You can change "Maximum Heading Level" to as many headers as you need. This ensures that the table of contents will only contain links to sections according to the number of headings within your article.

  2. Under "Exclude Headings," type Table of Contents. This will ensure that there will not be a link to the Table of Contents in the Table of Contents. 


Placing the "Table of Contents" Macro

Put the Table of Contents macro at the top of the article after the article summary but before the rest of the article. See the top of this article for an example. 

Time-Saving Tips

  1. When adding macros,

    1. Type "/" followed by the macro name.

    2. Select the macro you want to insert.

For a complete list of Confluence macros and other time-saving tips, see Confluence Macros and Confluence Keyboard Shortcuts.