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
    • temp, styles & lib
    • tt_*
    • resources
    • sitetitle
    • types
  • Content Objects (cObject)
    • Content objects (general information)
    • CASE
    • Content object array - COA, COA_INT
    • CONTENT
    • EDITPANEL
    • FILES
    • FLUIDTEMPLATE
      • dataProcessing
        • CommaSeparatedValueProcessor
        • DatabaseQueryProcessor
        • FilesProcessor
        • FlexFormProcessor
        • GalleryProcessor
        • LanguageMenuProcessor
        • MenuProcessor
        • SiteProcessor
        • SplitProcessor
        • Custom data processors
    • HMENU
      • 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
    • IMG_RESOURCE
    • LOAD_REGISTER
    • RECORDS
    • RESTORE_REGISTER
    • SVG
    • TEXT
    • USER and USER_INT
  • MENU
    • TMENU
    • TMENUITEM
  • GIFBUILDER
    • GIFBUILDER
    • Object names in this section
    • Examples
    • NON-Gifbuilder Objects
  • 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
  • Index

PAGE CONTENTS

  • Keywords - menu of related pages
    • Properties
      • special.value
      • special.mode
      • special.entryLevel
      • special.depth
      • special.limit
      • special.excludeNoSearchPages
      • special.begin
      • special.setKeywords
      • special.keywordsField
      • special.keywordsField.sourceField
    • Example
      • Menu of related pages
  1. Start
  2. Content Objects (cObject)
  3. HMENU
  4. Keywords - menu of related pages
View source How to edit Edit on GitHub

Display settings


Color scheme of code blocks:


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

    • 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¶

Property

special.value

Data type

integer /stdWrap

Description

Page for which keywords to find similar pages

Example:

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
}

special.mode¶

Property

special.mode

Data type

string

Default

SYS_LASTCHANGED

Description

Which field in the pages table to use for sorting.

Possible values are:

SYS_LASTCHANGED:

Is updated to the youngest tstamp 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 pagerecord, which is set automatically when the record is changed.

crdate:

Uses the "crdate"-field of the pagerecord.

starttime:

Uses the starttime field.

special.entryLevel¶

Property

special.entryLevel

Data type

integer

Description

Where in the rootline the search begins.

See property entryLevel in the HMENU.

special.depth¶

Property

special.depth

Data type

integer

Default

20

Description

(same as in section "special = updated")

special.limit¶

Property

special.limit

Data type

integer

Default

10

Description

(same as in section "special = updated")

special.excludeNoSearchPages¶

Property

special.excludeNoSearchPages

Data type

boolean

Description

(same as in section "special = updated")

special.begin¶

Property

special.begin

Data type

boolean

Description

(same as in section "special = updated")

special.setKeywords¶

Property

special.setKeywords

Data type

string /stdWrap

Description

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¶

Property

special.keywordsField

Data type

string

Default

keywords

Description

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¶

Property

special.keywordsField.sourceField

Data type

string

Default

keywords

Description

Defines the field from the current page from which to take the keywords being matched. The default is "keyword". (Notice that ".keywordsField" is only setting the page-record field to search in!)

[tsref:(cObject).HMENU.special = keywords]

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
                }
            }
        }
    }
}

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>
  • Previous
  • Next
  • Home
  • Contact
  • Issues
  • Repository

Last updated: Mar 17, 2023 17:30

Last rendered: Mar 17, 2023 17:31

  • TYPO3 Theme 4.7.9
  • DRC v3.0.dev30
© Copyright since 2012 by the TYPO3 contributors
  • Legal Notice
  • Privacy Policy
  • Code of Conduct