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

On this page:

Usage with the Macro Browser

To insert the blog posts macro into a page using the Macro Browser,

  1. Open the Confluence page or blog post that you want to edit, then click the 'Edit' button.
  2. Click the Macro Browser icon on the toolbar. The macro browser window will open.
  3. Scroll through the list of macros to find the one you want. Alternatively, start typing the macro name into the search box at the top right of the macro browser. Macros with a matching name will appear in the main pane.
  4. Click the desired macro.
  5. Set the macro parameters to your requirements. If desired, you can preview these changes by clicking 'Refresh'.
  6. Click 'Insert' to add the macro onto the page.

(tick) You can also insert macros via autocomplete. For more information, see Using Autocomplete in the Rich Text Editor.

Once you've found the blog posts macro, click 'insert' to add it to your page.

Usage with the Wiki Markup Editor

Simply type the following into the Wiki Markup editor:

{blog-posts}

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

必要な入力項目

表示結果

{blog-posts:space=~mryall}
Testing news

This is a test post.

パラメーター

Parameters are options that you can include in Confluence macros to control the content or format of the macro output. The table below lists relevant parameters for this macro.

Parameter names are different in the macro browser and in wiki markup. Below we show the macro browser parameter names in bold text, and the equivalent wiki markup parameters in (bracketed) text. If we do not show any parameter name for the wiki markup, then you should leave out the parameter name and simply include the parameter value as the first parameter, immediately after the colon (:).

パラメーター

既定

説明

(author)

なし

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.

Content Type to Display
(content)

entire

利用可能な値:

  • 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)

なし

ラベルを条件にしてフィルターをかけます。ここで指定したラベル(複数可)によってタグ付けされているブログ投稿だけがマクロによって表示されます。

カンマまたはスペースで区切られた1つ以上のラベル値を指定します。

  • 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'.
  • 特定のラベル値を持つ結果のみを指定するには、ラベル値のすぐ前にプラス記号 (+) を追加します。例: ラベル値を +superpage,+goodpage と指定すると、少なくとも "superpage" と "goodpage" の 2 つのラベルを持つコンテンツのみを取得できます。

Restrict to these Labels
(labels)

なし

Exactly the same as label above.

Maximum Number of Blog Posts
(max)

15

表示される結果の最大数を指定します。結果は最初にソートされ、その後、最大のパラメータが適用されることにご注意ください。

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.

(info) this parameter is ignored if the sort parameter is not specified.

Sort By
(sort)

作成日

Specify how the results should be sorted. To change the sort order from ascending to descending, use the reverse parameter described above.

(info) If this parameter is not specified, the sort order defaults to descending order based on the creation (publish) date.

Values:

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

Restrict to these spaces
(space)

@self、すなわちマクロが書かれたページを含むスペース

このパラメータを使用すれば、スペースを検索条件にしてコンテンツにフィルターをかけられます。ここで指定したスペース(複数可)に属するページだけがマクロによって表示されます。

カンマまたはスペースで区切られた、1つ以上のスペースキーを指定します。

  • 特定のスペースのコンテンツを除外するには、スペース キーのすぐ前にマイナス記号 (-) を追加します。例: スペース キーを -BADSPACE と指定すると、BADSPACE に含まれないコンテンツのみを取得できます。
  • 特定のスペースのコンテンツのみを指定するには、スペース キーのすぐ前にプラス記号 (+) を追加します。例: スペース キーを +GOODSPACE と指定すると、GOODSPACE のコンテンツのみを取得できます (各コンテンツ項目は 1 つのスペースにのみ所属するため、このオプションが有効な麺は少ないことにご注意ください。1 つのスペース キーの前にプラス記号を設定してほかのスペース キーを一覧に追加した場合、追加したスペース キーは無視されます)。

特別な値:

  • @self — 現在のスペース。
  • @personal — All personal spaces.
  • @global — All global spaces.
  • @favorite — The spaces you have marked as favourite.
  • @favourite — 上記の @favorite と同様。
  • @all — Confluence サイトのすべてのスペース。
  • * — 上記の @all と同様。

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

Restrict to these spaces
(spaces)

 

Exactly the same as space above.

Time Frame
(time)

制限なし

Confluence でブログ投稿をどこまでさかのぼって表示するか指定します。

利用可能な値:

  • m — 分
  • 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.

1. Specify the number of blog posts you want displayed

The following code will display a maximum of five blog posts:

{blog-posts:max=5}

2. Display short excerpts from each blog post in the list

{blog-posts:content=excerpts}

3. Display only the titles of the blog post

{blog-posts:content=titles}

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.

{blog-posts:time=12h}

The following code will display all blog posts posted in the last 2 weeks.

{blog-posts:time=2w}

5. Filter items using labels

The following code will display blog posts that contain the labels 'atlassian' or the label 'confluence' (or both):

{blog-posts:labels=atlassian,confluence}

The following code will display blog posts that contain the labels 'atlassian' and 'confluence' — each blog post must be tagged with both labels:

{blog-posts:labels=+atlassian,+confluence}

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):

{blog-posts:spaces=MKTG,~jsmith}

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:

{blog-posts:max=10|labels=logo|spaces=MKT|content=titles}

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:

{blog-posts:sort=modified|reverse=true}
関連トピック

Working with Macros
Working with Blog Posts

Take me back to the Confluence User's Guide.

  • ラベルなし