TYPO3 Logo
TypoScript Reference
Release: 11.5

Loading data.

  • Introduction
  • Using and setting TypoScript
    • Add TypoScript in the backend
    • Add TypoScript in your extension
    • Constants
    • The constant editor
    • Register
    • Debugging / analyzing
  • Simple data types
  • Top-level objects
    • CONFIG & config
    • constants
    • _GIFBUILDER
    • module
    • PAGE
      • PAGE Examples
    • plugin
    • Reserved top-level objects
  • Content Objects (cObject)
    • Content objects (general information)
    • CASE
    • Content object array - COA, COA_INT
    • CONTENT
    • EDITPANEL
    • FILES
    • FLUIDTEMPLATE
    • HMENU
      • TMENU
        • TMENUITEM
      • Browse - previous and next links
      • Categories HMENU
      • Directory menu - menu of subpages
      • Keywords - menu of related pages
      • Language menu
      • List menu
      • Rootline - breadcrumb menu
      • Updated HMENU
      • Userfunction menu
    • IMAGE
      • GIFBUILDER
        • Examples
        • Note on (+calc)
        • Properties
        • GIFBUILDER objects
          • ADJUST
          • BOX
          • CROP
          • EFFECT
          • ELLIPSE
          • EMBOSS
          • IMAGE
          • OUTLINE
          • SCALE
          • SHADOW
          • TEXT
          • WORKAREA
    • IMG_RESOURCE
    • LOAD_REGISTER
    • RECORDS
    • RESTORE_REGISTER
    • SVG
    • TEXT
    • USER and USER_INT
  • dataProcessing
    • CommaSeparatedValueProcessor
    • DatabaseQueryProcessor
    • FilesProcessor
    • FlexFormProcessor
    • GalleryProcessor
    • LanguageMenuProcessor
    • MenuProcessor
    • SiteProcessor
    • SplitProcessor
    • Custom data processors
  • Functions
    • cache
    • Calc
    • Data / getText
    • encapsLines
    • getEnv
    • HTMLparser
    • HTMLparser_tags
    • if
    • imageLinkWrap
    • imgResource
    • makelinks
    • numberFormat
    • numRows
    • optionSplit
    • parseFunc
    • replacement
    • round
    • select
    • split
    • stdWrap
    • strPad
    • tags
    • typolink
  • Conditions
  • Appendix A – PHP include scripts
  • Glossary
  • About This Manual
  • Sitemap

Contributors Corner

  • View source of current document
  • How to edit
  • Edit current document on GitHub
  1. TypoScript Reference
  2. Content Objects (cObject)
  3. HMENU
  4. Keywords - menu of related pages
Report issue View source How to edit Edit on GitHub

Attention

TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.

Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.

Keywords - menu of related pages

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

Mount pages are supported.

  • Properties
    • special.value
      • Example: Find related pages of the current page
    • special.mode
    • special.entryLevel
    • special.depth
    • special.limit
    • special.excludeNoSearchPages
    • special.begin
    • special.setKeywords
    • special.keywordsField
    • special.keywordsField.sourceField
  • Example: Menu of related pages

Properties

special.value

special.value

special.value
Type
integer /stdWrap

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

Example: Find related pages of the current page

EXT:site_package/Configuration/TypoScript/setup.typoscript
lib.relatedPagesMenu = HMENU
lib.relatedPagesMenu {
    special = keywords
    special {
        value.data = TSFE:id
        entryLevel = 1
        mode = manual
    }
    // render the menu
}
Copied!

special.mode

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

special.entryLevel

special.entryLevel
Type
integer

Where in the root line the search begins.

See property entryLevel in the HMENU.

special.depth

special.depth

special.depth
Type
integer
Default
20

Same as in section "special = updated".

special.limit

special.limit

special.limit
Type
integer
Default
10

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

special.excludeNoSearchPages

special.excludeNoSearchPages

special.excludeNoSearchPages
Type
boolean
Default
false
Property
special.excludeNoSearchPages
Data type
boolean
Description
If set, pages marked No search are not included.

special.begin

special.begin

special.begin
Type
boolean

special.setKeywords

special.setKeywords

special.setKeywords
Type
string /stdWrap

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

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

special.keywordsField.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 is only setting the page record field to search in!)

Example: Menu of related pages

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 and provides all its properties:

EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/MenuRelatedPages.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 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
        10 {
            special = keywords
            special {
                value.field = pages
                excludeNoSearchPages = 1
            }
            alternativeSortingField = title
            dataProcessing {
                10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                10 {
                    references.fieldName = media
                }
            }
        }
    }
}
Copied!

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

EXT:fluid_styled_content/Resources/Private/Templates/MenuRelatedPages.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>
Copied!
  • Previous
  • Next
Reference to the headline

Copy and freely share the link

This link target has no permanent anchor assigned. You can make a pull request on GitHub to suggest an anchor. The link below can be used, but is prone to change if the page gets moved.

Copy this link into your TYPO3 manual.

  • Home
  • Contact
  • Issues
  • Repository

Last rendered: Oct 16, 2024 07:45

© since 2012 by the TYPO3 contributors
  • Legal Notice
  • Privacy Policy