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

  • Browse - previous and next links
    • Properties
      • special.value
      • special.items
      • special.items.prevnextToSection
      • special.[itemname].target
      • special.[itemname].uid
      • special.[itemname].fields.[field name]
      • special.excludeNoSearchPages
    • Example
      • Pagination with rel="next" and rel="prev"
  1. Start
  2. Content Objects (cObject)
  3. HMENU
  4. Browse - previous and next links
View source How to edit Edit on GitHub

Display settings


Color scheme of code blocks:


Browse - previous and next links¶

This menu contains pages which give your user the possibility to browse to the previous page, to the next page, to a page with the table of contents and so on. The menu is built of items given by a list from the property ".items".

Attention

Mount pages are not supported!

  • Properties

    • special.value

    • special.items

    • special.items.prevnextToSection

    • special.[itemname].target

    • special.[itemname].uid

    • special.[itemname].fields.[field name]

    • special.excludeNoSearchPages

  • Example

    • Pagination with rel="next" and rel="prev"

Properties¶

special.value¶

Property

special.value

Data type

integer /stdWrap

Default

current page id

Description

Default is the current page id. Seldom you might want to override this value with another page-uid which will then act as the base point for the menu and the predefined items.

special.items¶

Property

special.items

Data type

list of item names separated by "|"

Description

Each element in the list (separated by "|") is either a reserved item name (see list) with a predefined function, or a user-defined name which you can assign a link to any page. Note that the current page cannot be the root-page of a site.

Reserved item names:

next / prev: Links to the next page / the previous page. Next and previous pages are from the same "pid" as the current page id (or "value") - that is the next item in a menu with the current page. Also referred to as current level.

If ".prevnextToSection" is set then next/prev will link to the first page of the next section / to the last page of the previous section, too.

nextsection / prevsection: Links to the next section / the previous section. A section is defined as the subpages of a page on the same level as the parent (pid) page of the current page. Will not work if the parent page of the current page is the root page of the site.

Example for the usage of the property "items".

nextsection_last / prevsection_last: Where nextsection/prevsection links to the first page in a section, these link to the last pages. If there is only one page in the section that will be both first and last. Will not work if the parent page of the current page is the root page of the site.

first / last: First / last page on the current level. If there is only one page on the current level that page will be both first and last.

up: Links to the parent (pid) page of the current page (up 1 level). Will always be available.

index: Links to the parent of the parent page of the current page(up 2 levels). May not be available, if that page is out of the rootline.

Examples:

If id = 20 is the current page then:

21 = prev and first, 19 = next, 18 = last, 17 = up, 1 = index, 10 = nextsection, 11 = nextsection_last

prevsection and prevsection_last are not present because id = 3 has no subpages!

TypoScript (only "browse"-part, needs also TMENU):

EXT:site_package/Configuration/TypoScript/setup.typoscript¶
xxx = HMENU
xxx.special = browse
xxx.special {
  items = index|up|next|prev
  items.prevnextToSection = 1
  index.target = _blank
  index.fields.title = INDEX
  index.uid = 8
}

special.items.prevnextToSection¶

Property

special.items.prevnextToSection

Data type

boolean

Description

If set, the "prev" and "next" navigation will jump to the next section when it reaches the end of pages in the current section. That way "prev" and "next" will also link to the first page of the next section / to the last page of the previous section.

special.[itemname].target¶

Property

special.[itemname].target

Data type

string

Description

Optional/alternative target of the item.

special.[itemname].uid¶

Property

special.[itemname].uid

Data type

integer

Description

(uid of page) - optional/alternative page-uid to link to.

special.[itemname].fields.[field name]¶

Property

special.[itemname].fields.[field name]

Data type

string

Description

Override field "field name" in pagerecord.

Example:

EXT:site_package/Configuration/TypoScript/setup.typoscript¶
prev.fields.title = « back

This gives the link to the previous page the linktext "« back".

special.excludeNoSearchPages¶

Property

special.excludeNoSearchPages

Data type

boolean

Default

0 (false)

Description

If set, pages marked with the "no search" checkbox will be excluded from the menu.

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

Example¶

Pagination with rel="next" and rel="prev"¶

The following snippet uses a HMENU with special = browse to display links like the following:

Example HTML output¶
<link rel="prev" href="http://www.example.org/page1" />
<link rel="next" href="http://www.example.org/page2" />

The menu excludes pages with the flag Include in Search removed and jumps to the next section when the last of subpages is reached.

EXT:site_package/Configuration/TypoScript/Seo/Setup/RelPrevNextMenu.typoscript¶
page {
  headerData {
    // https://developers.google.com/search/blog/2011/09/pagination-with-relnext-and-relprev
    10 = HMENU
    10 {
      special = browse
      special {
        items = prev|next
        items.prevnextToSection = 1
        excludeNoSearchPages = 1
      }
      1 = TMENU
      1.NO {
        allWrap = <link rel="prev" href="|"> |*| <link rel="next" href="|">
        doNotLinkIt = 1
        stdWrap {
          typolink {
            parameter.data = field:uid
            returnLast = url
          }
        }
      }
    }
  }
}
  • 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