Package

ViewHelpers

ViewHelper Documentation

v: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

class string, required

CSS class(es) for this element

dir string, required

Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id string, required

Unique (in this file) identifier for this HTML element.

lang string, required

Language for this element. Use short names specified in RFC 1766

style string, required

Individual CSS styles for this element

title string, required

Tooltip text of element

accesskey string, required

Keyboard shortcut to access this element

tabindex integer, required

Specifies the tab order of this element

onclick string, required

JavaScript evaluated for the onclick event

forceClosingTag boolean, required

If TRUE, forces the created tag to use a closing tag. If FALSE, allows self-closing tags.

hideIfEmpty boolean, required

Hide the tag completely if there is no tag content

contenteditable string, required

Specifies whether the contents of the element are editable.

contextmenu string, required

The value of the id attribute on the menu with which to associate the element as a context menu.

draggable string, required

Specifies whether the element is draggable.

dropzone string, required

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 string, required

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 string, required

Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking.

hidden string, required

Specifies that the element represents an element that is not yet, or is no longer, relevant.

showAccessProtected boolean, required

If TRUE links to access protected pages are always rendered regardless of user login status

classAccessProtected string, required

Optional class name to add to links which are access protected

classAccessGranted string, required

Optional class name to add to links which are access protected but access is actually granted

useShortcutUid boolean, required

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 boolean, required

Optional param for using shortcut target instead of shortcut itself for current link

useShortcutData boolean, required

Shortcut to set useShortcutTarget and useShortcutData simultaneously

tagName string, required

Tag name to use for enclosing container

tagNameChildren string, required

Tag name to use for child nodes surrounding links. If set to "a" enables non-wrapping mode.

entryLevel integer, required

Optional entryLevel TS equivalent of the menu

levels integer, required

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 boolean, required

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

classFirst string, required

Optional class name for the first menu elment

classLast string, required

Optional class name for the last menu elment

classActive string, required

Optional class name to add to active links

classCurrent string, required

Optional class name to add to current link

classHasSubpages string, required

Optional class name to add to links which have subpages

substElementUid boolean, required

Optional parameter for wrapping the link with the uid of the page

showHiddenInMenu boolean, required

Include pages that are set to be hidden in menus

showCurrent boolean, required

If FALSE, does not display the current page

linkCurrent boolean, required

If FALSE, does not wrap the current page in a link

linkActive boolean, required

If FALSE, does not wrap with links the titles of pages that are active in the rootline

titleFields string, required

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 boolean, required

If TRUE, includes the page title as title attribute on the anchor.

includeSpacers boolean, required

Wether or not to include menu spacers in the page select query

deferred boolean, required

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 string, required

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 string, required

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 anySimpleType, required

Page UIDs to exclude from the menu. Can be CSV, array or an object implementing Traversable.

forceAbsoluteUrl boolean, required

If TRUE, the menu will be rendered with absolute URLs

doktypes anySimpleType, required

DEPRECATED: Please use typical doktypes for starting points like shortcuts.

divider string, required

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 integer, required

Optional parent page UID to use as top level of menu. If left out will be detected from rootLine using $entryLevel

ViewHelper Resources

Schema Resources