You can link to a specific location within a page, by marking that location with an Anchor macro and then linking to the anchor name. Anchor links can be especially useful when navigating between sections of a long document, or when you want to link to a segment of a page instead of the top of the page.

Anchors are invisible to the reader when the page is displayed.

アンカーを使用するには次の2つの手順を実行します。

  1. Create the anchor on the page.
  2. Create the link to the anchor.

Creating an anchor

Use the Anchor macro to mark the location you want to link to.

  1. Add the Anchor macro to a page.
    1. In the Confluence editor, choose Insert > Other Macros.
    2. Find and select the required macro.

    オートコンプリートでマクロを素早く入力する方法

    Type { and the beginning of the macro name, to see a list of suggested macros. Details are in Using Autocomplete.

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



  2. Specify the name of your anchor. For example, 'bottom' or 'important information'. See the 'Anchor Name' parameter described below.

マクロ オプション (パラメータ)

パラメータは、マクロ出力の内容や形式を制御するために設定するオプションです。

パラメーター

既定

説明

アンカー名

なし

これは、リンクの作成時に使用するアンカー名です。

  • アンカー名にはスペースを含めることができます。スペースは、Confluence によりこのアンカーをポイントする URL が作成されるときに自動的に削除されます。
  • The anchor name is case sensitive. You must use the same pattern of upper and lower case letters when creating the link as you use when creating the Anchor macro.

Creating a link to an anchor

次のものをアンカーのリンク元にすることができます。
  • A link on the same page as the anchor
  • Another page in the same space
  • A page in another space of the same Confluence site.
  • 別の Web ページまたは別の Confluence サイト (専用形式の URL を使用)。

同じ Confluence サイト内からアンカーにリンクするには、次の操作を実行します。

  1. リンクを配置するページを編集します。
  2. エディタのツールバーで [リンク] を選択するか、[Ctrl+K] を押します。
  3. [詳細] を選択し、[リンク] ボックスにアンカー名を入力します。ただし、次の点に注意してください。

    • アンカー名は大文字と小文字が区別されます。アンカー マクロの作成時に使用したパターンと同じ組み合わせで大文字と小文字を使用する必要があります。
    • 次の構文を使用します。

      アンカーの場所

      アンカーのリンク構文

      同じページ

      #anchorname

      #bottom

      #important information

      異なるページ

      pagename#anchorname

      My page#bottom

      My page#important information

      別のスペース内のページ

      spacekey:pagename#anchorname

      DOCS:My page#bottom

      DOCS:My page#important information

  4. 必要に応じて、ページに表示されるリンク テキスト (エイリアス) を入力します。[リンク テキスト] ボックスを空のままにすると、リンク先のページ名または URL が表示されます。
  5. [挿入] を選択します。

別の Web ページまたは別の Confluence サイトからアンカーにリンクするには:

次の形式で完全な URL を使用します。

リンク構文

http://myconfluence.com/display/spacekey/pagename#pagename-anchorname

http://myconfluence.com/display/DOCS/My+page#Mypage-bottom

http://myconfluence.com/display/DOCS/My+page#Mypage-importantinformation

完全な URL に関するメモ

  • ページ名は、URL 内で # 記号の後に反復されます。2回目のページ名は、すべてのスペースが削除されて単語になります。
  • 連結されたページ名とアンカー名の間にシングルダッシュ (ハイフン) があります。
  • 完全な URL でのアンカー名は、すべてのスペースが削除されて単語になります。
  • アンカー名は大文字と小文字が区別されます。アンカー マクロの作成時に使用したパターンと同じ組み合わせで大文字と小文字を使用する必要があります。

コー​​ドの例

参照先:

注意

  • Table of contents on page: Consider using the Table of Contents Macro to generate a list of links pointing to the headings on the page. The list of links will appear on the page, and will be automatically updated each time someone changes the wording of a heading.
  • Linking to headings: You can link directly to the headings of a page. See Linking to Pages. However, if someone changes the wording of a heading, those direct links will be broken. Use the Anchor macro to ensure a lasting link within the body of a page.
  • サイトのウェルカム メッセージ:サイトのウェルカム メッセージに使用しているページにアンカーを追加する場合、別のページからそのアンカーへのリンクのみ作成できます。そのページ内の内部リンクは機能しません。
  • テンプレート: テンプレートのプレビュー時には、アンカーへのリンクは "壊れた" リンクとして表示されます。しかし、テンプレートを使用してページを作成すると、完成したページのリンクは正しく機能します。