The Blog Posts macro allows you to display news items (blog posts) on a wiki page. Clicking on a title takes you to the news item.

On this page:

Basic Usage

{blog-posts}

Working Example of Usage

In the example below, we show the news items 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.

パラメーター

パラメーター

既定

説明

author

なし

Filter the results by author. The macro will display only the news items which are written by the author(s) you specify here.

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

  • To exclude content which was created or updated by a specific user, put a minus sign (-) immediately in front of the username. For example: If you specify a username of -hpotter you will get only content which the user 'hpotter' has neither created nor edited.
  • To indicate that the results must have been created or updated by least one of the specified users, simply list the usernames separated by commas. For example: If you specify usernames of -hpotter,hgranger,adumbledore you will get content which has been created/updated by either 'hgranger' or 'adumbledore' (or both) but 'hpotter' has not touched.
  • To indicate that the results must have been created or updated by a specific user, put a plus sign (+) immediately in front of the username. For example: If you specify the usernames as +hgranger,+adumbledore you will get content which has been updated by at least two people, being 'hgranger' and 'adumbledore'.

content

entire

利用可能な値:

  • content=excerpts — Display short excerpts from each news item. After each excerpt, the words 'Read more...' will offer a link allowing the user to click through to the full news item, if the content is over 500 characters long.
  • content=titles — Display a list of news items, showing titles only.

ラベル

なし

Filter the results by label. The macro will display only the news items 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 at least one of the specified label values, simply list the labels separated by commas. For example: If you specify a label value of -badpage,goodpage,superpage you will get content which has a label of either 'goodpage' or 'superpage' (or both) but does not have the label 'badpage'.
  • 特定のラベル値を持つ結果のみを指定するには、ラベル値のすぐ前にプラス記号 (+) を追加します。例: ラベル値を +superpage,+goodpage と指定すると、少なくとも "superpage" と "goodpage" の 2 つのラベルを持つコンテンツのみを取得できます。

labels

なし

Exactly the same as label above.

max

15

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

maxResults

15

Exactly the same as max above.

リバース

false

Use this parameter in conjunction with the sort parameter described below. Set reverse=true to change the sort from ascending to descending order.

Note: this parameter is ignored if the sort parameter is not specified.

並べ替え

作成日

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

Note: 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.

スペース

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

This parameter allows you to filter content by space. The macro will display only the pages etc which belong to the space(s) you specify here.

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

  • 特定のスペースのコンテンツを除外するには、スペース キーのすぐ前にマイナス記号 (-) を追加します。例: スペース キーを -BADSPACE と指定すると、BADSPACE に含まれないコンテンツのみを取得できます。
  • To indicate that the results must come from least one of the specified spaces, simply list the space keys separated by commas. For example: If you specify the space keys of YOURSPACE,GOODSPACE you will get content from both YOURSPACE and GOODSPACE.
  • 特定のスペースのコンテンツのみを指定するには、スペース キーのすぐ前にプラス記号 (+) を追加します。例: スペース キーを +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.

スペース

 

Exactly the same as space above.

時間

制限なし

Specify how far back in time Confluence should look for the news items to be displayed.
Available values:

  • m — 分
  • h — Hours
  • d — Days
  • w — Weeks
    For example, time=12h would display those news items created in the last twelve hours, and time=7d would show news items created in the last seven days.

1. Specify the number of news items you want displayed

The following code will display a maximum of five news items:

{blog-posts:max=5}

2. Display short excerpts from each news item in the list

{blog-posts:content=excerpts}

3. Display only the titles of the news item

{blog-posts:content=titles}

4. Choose how far back in time Confluence should look for the news items

The following code will display all news items posted in the last twelve hours.

{blog-posts:time=12h}

The following code will display all news items posted in the last 2 weeks.

{blog-posts:time=2w}

5. Filter items using labels

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

{blog-posts:labels=atlassian,confluence}

The following code will display news items that contain the labels 'atlassian' and 'confluence' — each news item 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 news items

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 News Overview

Take me back to Confluence User Guide

  • ラベルなし