Blog Posts Macro

Still need help?

The Atlassian Community is here for you.

Ask the community

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:

  1. In the Confluence editor, choose Insert > Other Macros
  2. 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

(content)

No

titles

Available values:

  • titles — Display the title, creator, space, and created date stamp for each blog post.
  • excerpts — Display a short excerpt from each blog post. If the post contains an Excerpt macro, the Blog Posts macro will display the content defined in the Excerpt macro. If the post does not contain an Excerpt macro, the Blog Posts macro will display the first few sentences of the post.
  • entire - Display the whole content of each blog post.

Time Frame
(time)

No

no limit

Specify how far back in time Confluence should look for the blog posts to be displayed.

Available values:

  • m — Minutes
  • h — Hours, so '12h' displays blog posts created in the last twelve hours.
  • d — Days, so '7d' displays blog posts created in the last seven days.
  • w — Weeks

Restrict to these Labels
(label)

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.

You can specify one or more label values, separated by a comma or a space.

  • To exclude content which matches a given label, put a minus sign (-) immediately in front of that label value. For example: If you specify a label value of -badpage you will get only content which is not labelled with 'badpage'.
  • To indicate that the results must match a given label value, put a plus sign (+) immediately in front of that label value. For example: If you specify a label value of +superpage,+goodpage you will get only content which has at least two labels, being 'superpage' and 'goodpage'.

Restrict to these Authors
(author

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
(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.

You can specify one or more space keys, separated by a comma or a space.

  • To exclude content in a specific space, put a minus sign (-) immediately in front of that space key. For example: If you specify a space key of -BADSPACE you will get only content which is not in the BADSPACE.
  • To indicate that the results must come from a specific space, put a plus sign (+) immediately in front of that space key. For example: If you specify a space key of +GOODSPACE you will get only content in GOODSPACE. (Note that this is not particularly useful, because each content item belongs to one space only. If you put a plus sign next to one space key and list other space keys too, the other space keys will be ignored.)
Special values:
  • @self — The current space.
  • @personal — All personal spaces.
  • @global — All site spaces.
  • @favorite — The spaces you have marked as favourite.
  • @favourite — The same as @favorite above.
  • @all — All spaces in your Confluence site.
  • * — The same as @all above.

When specifying a personal space, remember to use the tilde (~) sign in front of the username, such as ~jbloggs or ~jbloggs@example.com.

Maximum Number of Blog Posts
(max)

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
(sort)  

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.

Values:

  • title — Sort alphabetically by title.
  • creation — Sort by the date on which the content was added.
  • modified — Sort by the date on which the content was last updated.

Reverse Sort
(reverse) 

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 true changes the sort order.

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}

Last modified on Dec 2, 2015

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.