The {excerpt} macro defines a block of text as being the excerpt (or summary) for a page...
You will have noticed that every single page in this user guide begins with a short paragraph (in bold text) which summarises the page - those are excerpts.
They don't actually change the way the text looks (we've made each excerpt in this user guide bold ourselves), but they do mark the text as being the "official" summary for the page. Once marked, other Macros are then able to use the text more easily.
Add the macro to your page as follows:
{excerpt:hidden=true/false}summary text{excerpt}
Parameters
Parameter
Required
Notes
hidden
Set to true to hide the excerpt text or false (default) to display the text.
This macro is part of the standard Confluence Distribution.
The following example shows how to mark a block of text as the excerpt (it will be displayed on the page):
{excerpt}This is the summary for the page...{excerpt}
Which displays the text and marks it as the excerpt for the page:
This is the summary for the page...
Hidden Excerpt
There are cases where you might need to hide the excerpt - for example, on [USERGUIDE:News] items you wouldn't usually want to display the summary...
{excerpt:hidden=true}This is a hidden summary...{excerpt}
Which displays nothing, but marks the text as the summary for the page.
Bold Excerpt
We've made all the excerpts in this user guide bold - here's how...
*{excerpt}This is a bold excerpt...{excerpt}*
As you can see, we've used *'s around the exceprt to make it bold. The result:
This is a bold excerpt...
Because we've put the *'s outside the {excerpt} tags, the text will only appear bold on this page. When the excerpt is displayed elsewhere it will not be bold. If you wanted the excerpt to appear bold wherever it appeared, simply place the *'s inside the excerpt tags as follows:
{excerpt}*This is a bold excerpt...*{excerpt}
The result is the same when displayed on this page, however it would also appear in bold text wherever else the excerpt is displayed:
This is a bold excerpt...
Hints and Tips
Use excerpts whether you need them or not. You might get half way through developing a site (as we did!) and then suddenly realise you want to take advantage of excerpts! It's a lot easier to put the excerpts in while you are creating pages, etc., than it is to have to go back and add them in at a later date.
Keep excerpts fairly short and concise. You should never have more than one paragraph of text within an excerpt.
When writing an excerpt, imagine it appearing anywhere on your site without the page title - it should still make sense! If you do this, you'll be able to use things like the [USERGUIDE:include-random macro].
Frequently Asked Questions
Q
You mention that other macros can use excerpts - which ones?