The Excerpt macro is used to mark a part of a page's content for re-use. Defining an excerpt enables other macros, such as the Excerpt Include and Blog Posts macros, to display the marked content elsewhere.

You can only define one excerpt per page. In other words, you can only add the Excerpt macro once to a page.

Using the Excerpt Macro

To add the Excerpt macro to a page:

To add reusable content to the macro:

  1. Add your content inside the Excerpt macro placeholder.
  2. Choose the macro placeholder to see the options panel, and select the option to Display on new line or to Display inline. The default is to display the content of the macro on a new line. If you choose the inline option, the content of the macro will form part of the same paragraph as the text preceding and following it. Note that this option affects only the page that contains the Excerpt macro. It does not affect any pages where the content is reused.

Screenshot: The Excerpt macro placeholder and options panel

Parameters

Parameter

Default

Description

Hide Excerpted Content
(hidden

false

Controls whether the page content contained in the Excerpt macro placeholder is displayed on the page.

Note that this option affects only the page that contains the Excerpt macro. It does not affect any pages where the content is reused.

Code examples

The following examples are provided for advanced users who want to inspect or edit the underlying markup for a Confluence page. 

Macro name: excerpt

Macro body: Accepts rich text.

The following additional parameter is available in storage format and wikimarkup. It performs the same function as the options panel in the editor. 

Parameter nameRequiredDefaultParameter description and accepted values
atlassian-macro-output-typeNoBLOCK

Determines whether the content of the Excerpt macro body is displayed on a new line or inline.

Available values:

  • BLOCK – Displays the content of the macro on a new line.
  • INLINE – Displays the the content of the macro as part of the same paragraph as the text preceding and following it.

Note that this option affects only the page that contains the Excerpt macro. It does not affect any pages where the content is reused.

Storage format example

<ac:structured-macro ac:name="excerpt">
  <ac:parameter ac:name="hidden">true</ac:parameter>
  <ac:parameter ac:name="atlassian-macro-output-type">BLOCK</ac:parameter>
  <ac:rich-text-body>
    <p>This is the <strong>text</strong> I want to reuse in other pages. This text is inside an Excerpt macro.</p>
  </ac:rich-text-body>
</ac:structured-macro>

Wikimarkup example

{excerpt:hidden=true|atlassian-macro-output-type=BLOCK}
This is the *text* I want to reuse in other pages. This text is inside an Excerpt macro.
{excerpt}

Define a part of a page as the page's 'excerpt' which can then be displayed in another page.