The Content by Label macro displays links to pages, blog posts and attachments that have been tagged with specific labels.

ラベル別コンテンツマクロを利用する

ラベル別コンテンツマクロをページに追加する方法

  1. Confluence のエディタで、[挿入] > [その他のマクロ] を選択します。
  2. 対象のマクロを見つけて、選択します。

Speeding up macro entry with autocomplete: Type { and the beginning of the macro name, to see a list of suggested macros. Details are in Using Autocomplete.

既存のマクロを編集する方法: マクロのプレースホルダをクリックして、[編集] を選択します。マクロのパラメータが編集可能な場合、マクロのダイアログ ウィンドウが開きます。

パラメーター

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

パラメーター

既定

説明

ラベル
(labels

なし

Filter by label(s). The macro will display only the content tagged with the label(s) specified here. See also the Operator parameter below.

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

Author(s)
(author

なし

Filter by author. The macro will display only the content created or updated by the author(s) specified here.

Include this Content Type Only
(type

すべて

Filter by content type. The macro will display only the content of the type specified here.

Specify one or more content types, separated by a comma or a space.

特定のコンテンツ タイプのコンテンツを除外するには、そのコンテンツ タイプのすぐ前にマイナス記号 (-) を追加します。例: コンテンツ タイプを -blogpost と指定すると、ページと、ブログ投稿を除くその他すべてのコンテンツを取得できます。

利用可能な値:

Show Labels for Each Page
(showLabels

true

Show or hide labels in the results.

Show Space Name for Each Page
(showSpace

true

Show or hide spaces in the results.

List Title
(title

なし

Add a title or heading to the list.

Maximum Number of Pages
(max

15

Limit the maximum number of results to be displayed. Note that the results are sorted first, and then the maximum parameter is applied.

Display Excerpts
(excerpt

false

Include excerpts from each page listed. Note that you must have defined excerpts on each of those pages, by adding the excerpt macro to the page. Only the first few lines of the excerpt for each page are displayed.

Restrict to these Spaces
(spaces

@all

Filter by space. The macro will display only the content which belongs to the space(s) specified here.

Specify one or more space keys, separated by a comma or a space.

  • 特定のスペースのコンテンツを除外するには、スペース キーのすぐ前にマイナス記号 (-) を追加します。例: スペース キーを -BADSPACE と指定すると、BADSPACE に含まれないコンテンツのみを取得できます。
  • 特定のスペースのコンテンツのみを指定するには、スペース キーのすぐ前にプラス記号 (+) を追加します。例: スペース キーを +GOODSPACE と指定すると、GOODSPACE のコンテンツのみを取得できます (各コンテンツ項目は 1 つのスペースにのみ所属するため、このオプションが有効な麺は少ないことにご注意ください。1 つのスペース キーの前にプラス記号を設定してほかのスペース キーを一覧に追加した場合、追加したスペース キーは無視されます)。
特別な値:
  • @self — 現在のスペース。
  • @personal — All personal spaces.
  • @global — All site spaces.
  • @favorite — The spaces you have marked as favourite.
  • @favourite — 上記の @favorite と同様。
  • @all — Confluence サイトのすべてのスペース。
  • * — 上記の @all と同様。

個人用スペースを指定する場合、~jbloggs~jbloggs@example.com のように、ユーザー名の前にチルダ (~) 記号をつける必要があることにご注意ください。

Operator
(operator

または

The operator to apply when matching content against the labels specified in the Label(s) parameter:

  • OR – Display content with any of the non-prefixed labels.
  • AND  – Display content with all of the specified non-prefixed labels.

    (info) Note that this parameter only modifies the behaviour of the Label(s) parameter and only affects label values without a plus (+) or minus (-) sign prefix.

Sort By
(sort

modified

Specify how the results should be sorted.

Values:

  • タイトル — タイトルのアルファベット順で並べ替え
  • 作成日 - コンテンツが追加された日付で並べ替え。
  • 更新日 - コンテンツが最後に更新された日付で並べ替え。
Note: If this parameter is not specified, the sort order defaults to descending, based on the last modification date (latest first). To change the sort order from ascending to descending, use the Reverse Sort parameter.

逆順ソート
(reverse

false

Select Reverse Sort to change the sort from descending to ascending. Use this parameter in conjunction with the Sort By parameter. Reverse Sort is ignored if Sort By is not specified.

コー​​ドの例

次の例は、Confluence ページの基本的なマークアップを調べたり、編集したりする上級ユーザー向けに提供されています。 

 

マクロ名: contentbylabel

マクロ本文: なし。

保存形式の例

<ac:structured-macro ac:name="contentbylabel">
  <ac:parameter ac:name="spaces"/>
  <ac:parameter ac:name="author">admin,smaddox</ac:parameter>
  <ac:parameter ac:name="title">My labelled pages</ac:parameter>
  <ac:parameter ac:name="showLabels">false</ac:parameter>
  <ac:parameter ac:name="reverse">true</ac:parameter>
  <ac:parameter ac:name="sort">creation</ac:parameter>
  <ac:parameter ac:name="max">10</ac:parameter>
  <ac:parameter ac:name="excerpt">true</ac:parameter>
  <ac:parameter ac:name="labels">chocolate,cake</ac:parameter>
  <ac:parameter ac:name="showSpace">false</ac:parameter>
  <ac:parameter ac:name="type">page</ac:parameter>
  <ac:parameter ac:name="operator">AND</ac:parameter>
</ac:structured-macro>

Wiki マークアップ例

{contentbylabel:spaces=@personal,@self|author=admin,smaddox|title=My labelled pages|showLabels=false|reverse=true|sort=creation|max=10|excerpt=true|labels=chocolate,cake|showSpace=false|type=page|operator=AND}
  • ラベルなし