---
title: "Keywords - menu of related pages"
manual: "TypoScript Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3tsref:hmenu-special-keywords@main"
source: "DataProcessing/MenuProcessor/Keywords.rst"
rendered: "2026-09-19T06:55:14+00:00"
---

# Keywords - menu of related pages {#hmenu-special-keywords}

Makes a menu of pages, which contain one or more keywords also found
on the current page.

Mount pages are supported.

-   [Properties](https://docs.typo3.org/permalink/t3tsref:properties@main)
-   [Examples](https://docs.typo3.org/permalink/t3tsref:examples@main)

## Properties {#hmenu-special-keywords-properties}

### special.value {#hmenu-special-keywords-value}

-   **special.value**

    -   *Type:* integer /[stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)
    -   *Example:* [Example: Find related pages of the current page](https://docs.typo3.org/permalink/t3tsref:hmenu-special-keywords-value-example@main)

    UID of the page for which related pages by keyword should be found.

### special.mode {#hmenu-special-keywords-mode}

-   **special.mode**

    -   *Type:* string
    -   *Default:* `SYS_LASTCHANGED`

    Which field in the `pages` table should be used for sorting?

    Possible values are:

    -   **`SYS_LASTCHANGED`**

        Is updated to the youngest time stamp of the
        records on the page when a page is generated.

    -   **`manual` or `lastUpdated`**

        Uses the field `lastUpdated`, which
        can be set manually in the page record.

    -   **`tstamp`**

        Uses the `tstamp` field of the page record, which is set
        automatically when the record is changed.

    -   **`crdate`**

        Uses the `crdate` field of the page record. This field is set
        once on creation of the record and left unchanged afterwards.

    -   **`starttime`**

        Uses the `starttime` field.

### special.entryLevel {#hmenu-special-keywords-entrylevel}

-   **special.entryLevel**

    -   *Type:* integer

    Where in the root line the search begins.

    See property [entryLevel in the HMENU](https://docs.typo3.org/permalink/t3tsref:hmenu-entrylevel@main).

### special.depth {#hmenu-special-keywords-depth}

-   **special.depth**

    -   *Type:* integer
    -   *Default:* 20

    Same as in section ["special = updated"](https://docs.typo3.org/permalink/t3tsref:hmenu-special-updated-depth@main).

### special.limit {#hmenu-special-keywords-limit}

-   **special.limit**

    -   *Type:* integer
    -   *Default:* 10

    Maximal number of items in the menu. Default is 10, maximum is 100.

### special.excludeNoSearchPages {#hmenu-special-keywords-excludenosearchpages}

-   **special.excludeNoSearchPages**

    -   *Type:* boolean
    -   *Default:* false

    If set, pages marked `No search` are not included.

### special.begin {#hmenu-special-keywords-begin}

-   **special.begin**

    -   *Type:* boolean

### special.setKeywords {#hmenu-special-keywords-setkeywords}

-   **special.setKeywords**

    -   *Type:* string /[stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@main)

    Lets you define the keywords manually by defining them as a comma-
    separated list. If this property is defined, it overrides the default,
    which is the keywords of the current page.

### special.keywordsField {#hmenu-special-keywords-keywordsfield}

-   **special.keywordsField**

    -   *Type:* string
    -   *Default:* `keywords`

    Defines the field in the `pages` table in which to search for the
    keywords. Default is the field name `keyword`. No check is done to see
    if the field you enter here exists, so make sure to enter an existing field.

### special.keywordsField.sourceField {#hmenu-special-keywords-sourcefield}

-   **special.keywordsField.sourceField**

    -   *Type:* string
    -   *Default:* `keywords`

    Defines the field from the current page from which to take the
    keywords being matched. The default is `keyword`. (Notice that
    [special.setKeywords](https://docs.typo3.org/permalink/t3tsref:confval-hmenu-keywords-special-setkeywords@main) is only setting the
    page record field to *search in*!)

## Examples {#hmenu-special-keywords-examples}

### Example: Menu of related pages {#hmenu-special-keywords-example-related}

The content element **Menu > Related pages** provided by the system
Extension EXT:fluid_styled_content is configured with a
`MenuProcessor` which is based on
the options of the [HMENU](https://docs.typo3.org/permalink/t3tsref:cobj-hmenu@main) and provides all its properties:

**EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/MenuRelatedPages.typoscript**

```typoscript
# Related pages (based on keywords):
# ...
#
# CType: menu_related_pages

tt_content.menu_related_pages =< lib.contentElement
tt_content.menu_related_pages {
  templateName = MenuRelatedPages
  dataProcessing {
    10 = menu
    10 {
      special = keywords
      special {
        value.field = pages
        excludeNoSearchPages = 1
      }
      alternativeSortingField = title
      dataProcessing {
        10 = files
        10 {
          references.fieldName = media
        }
      }
    }
  }
}

```

The following Fluid template can be used to style the menu:

**EXT:fluid_styled_content/Resources/Private/Templates/MenuRelatedPages.fluid.html**

```html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="Main">

  <f:if condition="{menu}">
    <ul>
      <f:for each="{menu}" as="page">
        <li>
          <a href="{page.link}"{f:if(condition: page.target, then: ' target="{page.target}"')}{f:if(condition: page.current, then: ' aria-current="page"')} title="{page.title}">
            <span>{page.title}</span>
          </a>
        </li>
      </f:for>
    </ul>
  </f:if>

</f:section>
</html>

```

### Example: Find related pages of the current page {#hmenu-special-keywords-value-example}

**EXT:site_package/Configuration/Sets/Main/setup.typoscript**

```typoscript
lib.relatedPagesMenu = HMENU
lib.relatedPagesMenu {
  special = keywords
  special {
    value.data = page:uid
    entryLevel = 1
    mode = manual
  }
  // render the menu
}

```
