TYPO3 Logo
VHS: Fluid ViewHelpers
Options
View source How to edit Full documentation (single file)

VHS: Fluid ViewHelpers

  • Installation
  • Configuration
  • Usage
  • fluidtypo3/vhs
    • asset
    • call
    • const
    • debug
    • l
    • menu
    • or
    • tag
    • try
    • unless
    • asset
      • asset.prefetch
      • asset.script
      • asset.style
    • condition
      • context
        • condition.context.isBackend
        • condition.context.isCli
        • condition.context.isDevelopment
        • condition.context.isFrontend
        • condition.context.isProduction
        • condition.context.isTesting
      • form
        • condition.form.hasValidator
        • condition.form.isRequired
      • iterator
        • condition.iterator.contains
      • page
        • condition.page.hasSubpages
        • condition.page.isChildPage
        • condition.page.isLanguage
      • string
        • condition.string.contains
        • condition.string.isLowercase
        • condition.string.isNumeric
        • condition.string.isUppercase
      • type
        • condition.type.isArray
        • condition.type.isBoolean
        • condition.type.isDomainObject
        • condition.type.isFloat
        • condition.type.isInstanceOf
        • condition.type.isInteger
        • condition.type.isObject
        • condition.type.isQueryResult
        • condition.type.isString
        • condition.type.isTraversable
      • variable
        • condition.variable.isNull
        • condition.variable.isset
    • content
      • content.get
      • content.info
      • content.render
      • content.resources
      • random
        • content.random.get
        • content.random.render
      • resources
        • content.resources.fal
    • context
      • context.get
    • count
      • count.bytes
      • count.lines
      • count.substring
      • count.words
    • extension
      • extension.icon
      • extension.loaded
      • path
        • extension.path.absolute
        • extension.path.relative
        • extension.path.resources
        • extension.path.siteRelative
    • form
      • form.fieldName
    • format
      • format.append
      • format.case
      • format.dateRange
      • format.eliminate
      • format.hash
      • format.hide
      • format.markdown
      • format.plaintext
      • format.pregReplace
      • format.prepend
      • format.replace
      • format.sanitizeString
      • format.substring
      • format.tidy
      • format.trim
      • format.wordWrap
      • json
        • format.json.decode
        • format.json.encode
      • placeholder
        • format.placeholder.image
        • format.placeholder.lipsum
      • url
        • format.url.decode
        • format.url.encode
    • iterator
      • iterator.chunk
      • iterator.column
      • iterator.diff
      • iterator.explode
      • iterator.extract
      • iterator.filter
      • iterator.first
      • iterator.for
      • iterator.implode
      • iterator.indexOf
      • iterator.intersect
      • iterator.keys
      • iterator.last
      • iterator.loop
      • iterator.merge
      • iterator.next
      • iterator.pop
      • iterator.previous
      • iterator.push
      • iterator.random
      • iterator.range
      • iterator.reverse
      • iterator.shift
      • iterator.slice
      • iterator.sort
      • iterator.split
      • iterator.unique
      • iterator.values
    • math
      • math.average
      • math.ceil
      • math.cube
      • math.cubicRoot
      • math.division
      • math.floor
      • math.maximum
      • math.median
      • math.minimum
      • math.modulo
      • math.power
      • math.product
      • math.range
      • math.round
      • math.squareRoot
      • math.square
      • math.subtract
      • math.sum
    • media
      • media.audio
      • media.exists
      • media.extension
      • media.files
      • media.gravatar
      • media.image
      • media.pdfThumbnail
      • media.picture
      • media.size
      • media.source
      • media.spotify
      • media.video
      • media.vimeo
      • media.youtube
      • image
        • media.image.height
        • media.image.mimetype
        • media.image.width
    • menu
      • menu.browse
      • menu.deferred
      • menu.directory
      • menu.list
      • menu.sub
    • once
      • once.cookie
      • once.instance
      • once.session
      • once.standard
    • page
      • page.absoluteUrl
      • page.breadCrumb
      • page.footer
      • page.header
      • page.info
      • page.languageMenu
      • page.language
      • page.link
      • page.resources
      • page.rootline
      • page.staticPrefix
      • header
        • page.header.alternate
        • page.header.canonical
        • page.header.link
        • page.header.meta
        • page.header.title
      • menu
        • page.menu.browse
        • page.menu.deferred
        • page.menu.directory
        • page.menu.list
        • page.menu.sub
      • resources
        • page.resources.fal
    • random
      • random.number
      • random.string
    • render
      • render.ascii
      • render.cache
      • render.inline
      • render.record
      • render.request
      • render.template
      • render.uncache
    • resource
      • resource.collection
      • resource.file
      • resource.image
      • resource.language
      • resource.record
      • record
        • resource.record.fal
    • security
      • security.allow
      • security.deny
    • site
      • site.name
      • site.url
    • system
      • system.dateTime
      • system.timestamp
      • system.uniqId
    • uri
      • uri.gravatar
      • uri.image
      • uri.request
    • variable
      • variable.convert
      • variable.extensionConfiguration
      • variable.get
      • variable.pregMatch
      • variable.set
      • variable.typoscript
      • variable.unset
      • register
        • variable.register.get
        • variable.register.set
  • Changelog
  • Contribution
  • Changelog
  • Sitemap
  • Index
  1. VHS: Fluid ViewHelpers
  2. fluidtypo3/vhs
  3. menu

menu ViewHelper <vhs:menu>

Page: Menu ViewHelper

ViewHelper for rendering TYPO3 menus in Fluid

Supports both automatic, tag-based rendering (which defaults to ul > li with options to set both the parent and child tag names. When using manual rendering a range of support CSS classes are available along with each page record.

Arguments

additionalAttributes

DataType
mixed
Required
false
Description
Additional tag attributes. They will be added directly to the resulting HTML tag.

data

DataType
mixed
Required
false
Description
Additional data-* attributes. They will each be added with a "data-" prefix.

aria

DataType
mixed
Required
false
Description
Additional aria-* attributes. They will each be added with a "aria-" prefix.

class

DataType
string
Required
false
Description
CSS class(es) for this element

dir

DataType
string
Required
false
Description
Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id

DataType
string
Required
false
Description
Unique (in this file) identifier for this HTML element.

lang

DataType
string
Required
false
Description
Language for this element. Use short names specified in RFC 1766

style

DataType
string
Required
false
Description
Individual CSS styles for this element

title

DataType
string
Required
false
Description
Tooltip text of element

accesskey

DataType
string
Required
false
Description
Keyboard shortcut to access this element

tabindex

DataType
integer
Required
false
Description
Specifies the tab order of this element

onclick

DataType
string
Required
false
Description
JavaScript evaluated for the onclick event

forceClosingTag

DataType
boolean
Required
false
Description
If TRUE, forces the created tag to use a closing tag. If FALSE, allows self-closing tags.

hideIfEmpty

DataType
boolean
Required
false
Description
Hide the tag completely if there is no tag content

contenteditable

DataType
string
Required
false
Description
Specifies whether the contents of the element are editable.

contextmenu

DataType
string
Required
false
Description
The value of the id attribute on the menu with which to associate the element as a context menu.

draggable

DataType
string
Required
false
Description
Specifies whether the element is draggable.

dropzone

DataType
string
Required
false
Description
Specifies what types of content can be dropped on the element, and instructs the UA about which actions to take with content when it is dropped on the element.

translate

DataType
string
Required
false
Description
Specifies whether an elements attribute values and contents of its children are to be translated when the page is localized, or whether to leave them unchanged.

spellcheck

DataType
string
Required
false
Description
Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking.

hidden

DataType
string
Required
false
Description
Specifies that the element represents an element that is not yet, or is no longer, relevant.

showAccessProtected

DataType
boolean
Required
false
Description
If TRUE links to access protected pages are always rendered regardless of user login status

classAccessProtected

DataType
string
Default
'protected'
Required
false
Description
Optional class name to add to links which are access protected

classAccessGranted

DataType
string
Default
'access-granted'
Required
false
Description
Optional class name to add to links which are access protected but access is actually granted

useShortcutUid

DataType
boolean
Required
false
Description
If TRUE, substitutes the link UID of a shortcut with the target page UID (and thus avoiding redirects) but does not change other data - which is done by using useShortcutData.

useShortcutTarget

DataType
boolean
Required
false
Description
Optional param for using shortcut target instead of shortcut itself for current link

useShortcutData

DataType
boolean
Required
false
Description
Shortcut to set useShortcutTarget and useShortcutData simultaneously

tagName

DataType
string
Default
'ul'
Required
false
Description
Tag name to use for enclosing container

tagNameChildren

DataType
string
Default
'li'
Required
false
Description
Tag name to use for child nodes surrounding links. If set to "a" enables non-wrapping mode.

entryLevel

DataType
integer
Required
false
Description
Optional entryLevel TS equivalent of the menu

levels

DataType
integer
Default
1
Required
false
Description
Number of levels to render - setting this to a number higher than 1 (one) will expand menu items that are active, to a depth of $levels starting from $entryLevel

expandAll

DataType
boolean
Required
false
Description
If TRUE and $levels > 1 then expands all (not just the active) menu items which have submenus

classFirst

DataType
string
Required
false
Description
Optional class name for the first menu elment

classLast

DataType
string
Required
false
Description
Optional class name for the last menu elment

classActive

DataType
string
Default
'active'
Required
false
Description
Optional class name to add to active links

classCurrent

DataType
string
Default
'current'
Required
false
Description
Optional class name to add to current link

substElementUid

DataType
boolean
Required
false
Description
Optional parameter for wrapping the link with the uid of the page

showHiddenInMenu

DataType
boolean
Required
false
Description
Include pages that are set to be hidden in menus

showCurrent

DataType
boolean
Default
true
Required
false
Description
If FALSE, does not display the current page

linkCurrent

DataType
boolean
Default
true
Required
false
Description
If FALSE, does not wrap the current page in a link

linkActive

DataType
boolean
Default
true
Required
false
Description
If FALSE, does not wrap with links the titles of pages that are active in the rootline

titleFields

DataType
string
Default
'nav_title,title'
Required
false
Description
CSV list of fields to use as link label - default is "nav_title,title", change to for example "tx_myext_somefield,subtitle,nav_title,title". The first field that contains text will be used. Field value resolved AFTER page field overlays.

includeAnchorTitle

DataType
boolean
Default
true
Required
false
Description
If TRUE, includes the page title as title attribute on the anchor.

includeSpacers

DataType
boolean
Required
false
Description
Wether or not to include menu spacers in the page select query

deferred

DataType
boolean
Required
false
Description
If TRUE, does not output the tag content UNLESS a v:page.menu.deferred child ViewHelper is both used and triggered. This allows you to create advanced conditions while still using automatic rendering

as

DataType
string
Default
'menu'
Required
false
Description
If used, stores the menu pages as an array in a variable named after this value and renders the tag content. If the tag content is empty automatic rendering is triggered.

rootLineAs

DataType
string
Default
'rootLine'
Required
false
Description
If used, stores the menu root line as an array in a variable named according to this value and renders the tag content - which means automatic rendering is disabled if this attribute is used

excludePages

DataType
mixed
Required
false
Description
Page UIDs to exclude from the menu. Can be CSV, array or an object implementing Traversable.

forceAbsoluteUrl

DataType
boolean
Required
false
Description
If TRUE, the menu will be rendered with absolute URLs

doktypes

DataType
mixed
Required
false
Description
DEPRECATED: Please use typical doktypes for starting points like shortcuts.

divider

DataType
string
Required
false
Description
Optional divider to insert between each menu item. Note that this does not mix well with automatic rendering due to the use of an ul > li structure

pageUid

DataType
integer
Required
false
Description
Optional parent page UID to use as top level of menu. If left out will be detected from rootLine using $entryLevel
  • Previous
  • Next
Reference to the headline

Copy and freely share the link

This link target has no permanent anchor assigned.The link below can be used, but is prone to change if the page gets moved.

Copy this link into your TYPO3 manual.

Last rendered: May 06, 2025 14:18

  • Legal Notice
  • Privacy Policy