Blog Posts Macro
The Blog Posts macro allows you to display blog posts on a Confluence page. Clicking on a title takes you to the blog post.
Using the Blog Posts Macro
To add the Blog Posts macro to a page:
- In the Confluence editor, choose Insert > Other Macros
- Find and select the required macro
Speeding up macro entry with autocomplete: Type { and the beginning of the macro name, to see a list of suggested macros. Details are in Autocomplete for links, files, macros and mentions.
To edit an existing macro: Click the macro placeholder and choose Edit. A macro dialog window will open, where you can edit the parameters of the macro.
Parameters
Parameters are options that you can set to control the content or format of the macro output. Where the parameter name used in Confluence storage format or wikimarkup is different to the label used in the macro browser, it will be listed below in brackets (example
).
Parameter | Required | Default | Description |
---|---|---|---|
Content Type to Display ( | No | titles | Available values:
|
Time Frame | No | no limit | Specify how far back in time Confluence should look for the blog posts to be displayed.
|
Restrict to these Labels | No | None | Filter the results by label. The macro will display only the blog posts which are tagged with the label(s) you specify here.
|
Restrict to these Authors | No | None | Filter the results by author. The macro will display only the blog posts which are written by the author(s) you specify here. |
Restrict to these Spaces | No | @self, i.e. the space which contains the page on which the macro is coded | This parameter allows you to filter content by space. The macro will display only the pages which belong to the space(s) you specify here.
When specifying a personal space, remember to use the tilde (~) sign in front of the username, such as |
Maximum Number of Blog Posts | No | 15 | Specify the maximum number of results to be displayed. Note that the results are sorted first, and then the maximum parameter is applied. |
Sort By | No | creation | Specify how the results should be sorted. If this parameter is not specified, the sort order defaults to descending order (newest first) based on the creation date.
|
Reverse Sort | No | false | Select to change the sort from descending to ascending order (oldest first). Use this parameter in conjunction with the Sort By parameter. This parameter is ignored if the Sort By parameter is not specified. In storage format and wikimarkup a value of |
Code examples
The following examples are provided for advanced users who want to edit the underlying markup for a Confluence page.
Macro name: blog-posts
Macro body: None.
Storage format example
<ac:structured-macro ac:name="blog-posts">
<ac:parameter ac:name="content">titles</ac:parameter>
<ac:parameter ac:name="spaces">
<ri:space ri:space-key="ds"/>
</ac:parameter>
<ac:parameter ac:name="author">
<ri:user ri:userkey="12345678912345678912345678912345"/>
</ac:parameter>
<ac:parameter ac:name="time">4w</ac:parameter>
<ac:parameter ac:name="sort">creation</ac:parameter>
<ac:parameter ac:name="max">10</ac:parameter>
<ac:parameter ac:name="labels">chocolate,cookies</ac:parameter>
</ac:structured-macro>
Wiki markup example
{blog-posts:content=titles|spaces=@self,ds|author=jsmith|time=4w|reverse=true|sort=creation|max=10|label=chocolate,cookies}