Table of contents and cluster structure

For easy navigation through Wiki pages and clusters, you can add a table of contents and a cluster structure (a list of subpages) to the page.

Page's table of contents

The Table of contents block displays a list of headings from the page.

To add a table of contents to the current or any other Wiki page:

  1. On the toolbar, click Other actions and select Table of contents.

    You can also use the quick access menu: type / and select a command from the list.

  2. In block settings, specify the parameters:

    • Specify the URL of the page for which you want to generate a table of contents in the following format: /<cluster>/<subcluster>/<page_name>. For example, for a page at https://wiki.yandex.com/users/username/my-page/, enter /users/username/my-page/.

      If you don't specify an address, the table of contents will be added to the current page.

    • In the From and To fields, specify the maximum and minimum heading levels to include in the table of contents.

      If you leave the — value, the table of contents will include heading levels from 1 to 6.

  3. Click Save.

To change a previously created page table of contents, in edit mode, click in the top right corner of the block.

Use this markup to add a table of contents to the page:

{% toc page="/<cluster>/<subcluster>/<page_name>" from="h1" to="h6" %}

For example: {% toc page="/users/username/my-page" from="h1" to="h6" %}.

Markup parameters:

  • page: Address of the page for which you want to generate a table of contents. Specified relative to the homepage.

  • from, to: Heading levels to include in the table of contents, from highest to lowest. Acceptable values are from h1 to h6.

Cluster structure

The Cluster structure block provides a tree view of all pages in the cluster.

To add a page list for this cluster:

  1. Open the toolbar in edit mode, click Other actions, and select Cluster structure.

    You can also use the quick access menu: type / and select a command from the list.

  2. In block settings, specify the parameters:

    • Address of the page for which you want to generate a subpage structure. Specified relative to the homepage. For example, for a cluster at https://wiki.yandex.com/team/marketing, enter /team/marketing.
      If you don't specify an address, the structure will be generated for the current page.
    • Depth: Number of cluster nesting levels to display in the structure, including the current page.
    • Sort by: Name, date created, or date updated.
    • Sorting order: Ascending or descending.
  3. Click Save.

A section with the cluster structure will appear on the page. To edit or delete a previously created cluster structure, in edit mode, click in the top right corner of the block.

Use this markup to add the specified cluster structure to the page:

{% tree page="/<cluster>/<subcluster>" depth="5" sort="asc" sort_by="title" %}

For example: {% tree page="/users/username depth="5" sort="asc" sort_by="title" %}.

Parameters:

  • page: Address of the page for which you want to generate a subpage structure. Specified relative to the homepage.
  • depth: Number of cluster nesting levels to display in the structure, including the current page.
  • sort: Sort pages:
    • asc: In ascending order
    • desc: In descending order
  • sort_by: Sorting parameter:
    • title: Name
    • created_at: Creaton date
    • modified_at: Modification date