Child pages
  • Blog Posts Macro

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
The *Blog Posts Macro* allows you to display blog posts on a wiki page. Clicking on a title takes you to the blog post. The blog posts macro will generate output like the screenshot below:

_+Screenshot: The Blog Posts Macro in Confluence+_

!Space Attachments Directory^Confluence_3.0_Blog_Posts_Macro_Screenshot.png|border=1,bordercolor=gray!

*On this page:*
{toc:minLevel=2|maxLevel=4}

h2. Usage with the Macro Browser

{color:#0099cc}{*}To insert the blog posts macro into a page using the Macro Browser,*{color}
{panel: borderStyle=dashed| borderColor=#ccc| titleBGColor=#F7D6C1| bgColor= #D5EFFF}
{excerpt-include:Navigating to the Macro Browser|nopanel=true}
Once you've found the blog posts macro, click '*insert*' to add it to your page.
{panel}

h2. Usage with the Wiki Markup Editor

Simply type the following into the Wiki Markup editor:

{code}
{blog-posts}
{code}

In the example below, we show the blog posts from a user's personal space on this Confluence site. (The person's username is {{\~mryall}}.)

|| What you need to type || What you will get ||
| {nomarkup}{blog-posts:space=~mryall}
{nomarkup} | {blog-posts:space=~mryall} |

h2. Parameters

{excerpt-include:_Details_about_macro_parameters|nopanel=true}

|| Parameter || Default || Description ||
| ({{author}}) | None | Filter the results by author. The macro will display only the blog posts which are written by the author(s) you specify here.
\\ \\
You can specify one or more authors, separated by a comma.
{excerpt-include:_Pattern Matching for Author Macro Parameter|nopanel=true} |
| *Content Type to Display*
({{content}}) | entire | Available values:
* {{content=excerpts}} --- Display short excerpts from each blog posts. After each excerpt, the words 'Read more...' will offer a link allowing the user to click through to the full blog post, if the content is over 500 characters long.
* {{content=titles}} --- Display a list of blog posts, showing titles only. |
| *Restrict to these Labels*
({{label}}) | 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.
{excerpt-include:_Pattern Matching for Label Macro Parameter|nopanel=true} |
| *Restrict to these Labels*
({{labels}}) | None | Exactly the same as {{label}} above. |
| *Maximum Number of Blog Posts*
({{max}}) | 15 | Specify the maximum number of results to be displayed. Note that the results are sorted first, and then the maximum parameter is applied. |
| *Maximum Number of Blog Posts*
({{maxResults}}) | 15 | Exactly the same as {{max}} above. |
| *Reverse Sort*
({{reverse}}) | false | Use this parameter in conjunction with the {{sort}} parameter described below. Set {{reverse=true}} to change the sort from ascending to descending order.
\\ \\
(i) this parameter is ignored if the {{sort}} parameter is not specified. |
| *Sort By*
({{sort}}) | creation | Specify how the results should be sorted. To change the sort order from ascending to descending, use the {{reverse}} parameter described above.
\\ \\
(i) If this parameter is not specified, the sort order defaults to descending order based on the creation (publish) date.
\\ \\
Values:
{excerpt-include:_Special Values for Sort Macro Parameter|nopanel=true} |
| *Restrict to these spaces*
({{space}}) | @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.
{excerpt-include:_Pattern Matching for Space Macro Parameter|nopanel=true}
Special values:
{excerpt-include:_Special Values for Space Macro Parameter|nopanel=true} |
| *Restrict to these spaces*
({{spaces}}) | | Exactly the same as {{space}} above. |
| *Time Frame*
({{time}}) | no limit | Specify how far back in time Confluence should look for the blog posts to be displayed.
\\ \\
Available values:
* {{m}} --- Minutes
* {{h}} --- Hours
* {{d}} --- Days
* {{w}} --- Weeks
\\ \\
For example, {{time=12h}} would display those blog posts created in the last twelve hours, and {{time=7d}} would show blog posts created in the last seven days. |

h2. Examples

h4. 1. Specify the number of blog posts you want displayed

The following code will display a maximum of five blog posts:
{code}
{blog-posts:max=5}
{code}

h4. 2. Display short excerpts from each blog post in the list
{code}
{blog-posts:content=excerpts}
{code}

h4. 3. Display only the titles of the blog post
{code}
{blog-posts:content=titles}
{code}

h4. 4. Choose how far back in time Confluence should look for the blog posts

The following code will display all blog posts posted in the last twelve hours.
{code}
{blog-posts:time=12h}
{code}
The following code will display all blog posts posted in the last 2 weeks.
{code}
{blog-posts:time=2w}
{code}

h4. 5. Filter items using labels

The following code will display blog posts that contain the labels 'atlassian' or the label 'confluence' (or both):
{code}
{blog-posts:labels=atlassian,confluence}
{code}
The following code will display blog posts that contain the labels 'atlassian' and 'confluence' --- each blog post must be tagged with both labels:
{code}
{blog-posts:labels=+atlassian,+confluence}
{code}

h4. 6. Filter items using spaces

The following code will display items from the 'Marketing' space (space key is {{MKTG}}) and Joe Smith's personal space (space key is {{\~jsmith}}):
{code}
{blog-posts:spaces=MKTG,~jsmith}
{code}

h4. 7. Combine parameters to filter the blog posts

The following code will display the latest 10 items in the 'Marketing' space (space key is {{MKT}}) with the label 'logo'. The items will be displayed as a list of titles only:
{code}
{blog-posts:max=10|labels=logo|spaces=MKT|content=titles}
{code}

h4. 8. Sort the results

Use the code below to sort the list of items by date last modified, with the most recent at the top:
{code}
{blog-posts:sort=modified|reverse=true}
{code}

h5. RELATED TOPICS

[Working with Macros]
[Working with Blog Posts]

Take me back to the [Wikis Help Guide].