Documentation · ViewHelper reference

XSD schema file | vhs master

Page / Menu / BrowseViewHelper

Page: Browse Menu ViewHelper

ViewHelper for rendering TYPO3 browse menus in Fluid

Renders links to browse inside a menu branch including first, previous, next, last and up to the parent page. 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.

DEPRECATED: use v:menu.browse instead

/

  • Tag usage example

    <v:page.menu.browse class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL" forceClosingTag="1" hideIfEmpty="1" contenteditable="NULL" contextmenu="NULL" draggable="NULL" dropzone="NULL" translate="NULL" spellcheck="NULL" hidden="NULL" showAccessProtected="1" classAccessProtected="'protected'" classAccessGranted="'access-granted'" useShortcutUid="1" useShortcutTarget="1" useShortcutData="1" tagName="'ul'" tagNameChildren="'li'" entryLevel="123" levels="123" expandAll="1" classFirst="''" classLast="''" classActive="'active'" classCurrent="'current'" classHasSubpages="'sub'" substElementUid="1" showHiddenInMenu="1" showCurrent="1" linkCurrent="1" linkActive="1" titleFields="'nav_title,title'" includeAnchorTitle="1" includeSpacers="1" deferred="1" as="'menu'" rootLineAs="'rootLine'" excludePages="[mixed]" forceAbsoluteUrl="1" doktypes="[mixed]" divider="NULL" labelFirst="'first'" labelLast="'last'" labelPrevious="'previous'" labelNext="'next'" labelUp="'up'" renderFirst="1" renderLast="1" renderUp="1" usePageTitles="1" pageUid="123" currentPageUid="123">
    	<!-- tag content - may be ignored! -->
    </v:page.menu.browse>
  • Inline usage example

    {v:page.menu.browse(class: 'NULL', dir: 'NULL', id: 'NULL', lang: 'NULL', style: 'NULL', title: 'NULL', accesskey: 'NULL', tabindex: 123, onclick: 'NULL', forceClosingTag: 1, hideIfEmpty: 1, contenteditable: 'NULL', contextmenu: 'NULL', draggable: 'NULL', dropzone: 'NULL', translate: 'NULL', spellcheck: 'NULL', hidden: 'NULL', showAccessProtected: 1, classAccessProtected: ''protected'', classAccessGranted: ''access-granted'', useShortcutUid: 1, useShortcutTarget: 1, useShortcutData: 1, tagName: ''ul'', tagNameChildren: ''li'', entryLevel: 123, levels: 123, expandAll: 1, classFirst: '''', classLast: '''', classActive: ''active'', classCurrent: ''current'', classHasSubpages: ''sub'', substElementUid: 1, showHiddenInMenu: 1, showCurrent: 1, linkCurrent: 1, linkActive: 1, titleFields: ''nav_title,title'', includeAnchorTitle: 1, includeSpacers: 1, deferred: 1, as: ''menu'', rootLineAs: ''rootLine'', excludePages: [mixed], forceAbsoluteUrl: 1, doktypes: [mixed], divider: 'NULL', labelFirst: ''first'', labelLast: ''last'', labelPrevious: ''previous'', labelNext: ''next'', labelUp: ''up'', renderFirst: 1, renderLast: 1, renderUp: 1, usePageTitles: 1, pageUid: 123, currentPageUid: 123)}

Arguments

Argument Description Type
accesskey

Keyboard shortcut to access this element

string
as

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.

string
class

CSS class(es) for this element

string
classAccessGranted

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

string
classAccessProtected

Optional class name to add to links which are access protected

string
classActive

Optional class name to add to active links

string
classCurrent

Optional class name to add to current link

string
classFirst

Optional class name for the first menu elment

string
classHasSubpages

Optional class name to add to links which have subpages

string
classLast

Optional class name for the last menu elment

string
contenteditable

Specifies whether the contents of the element are editable.

string
contextmenu

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

string
currentPageUid

Optional page UID to use as current page. If unspecified, current page UID from globals is used

integer
deferred

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

boolean
dir

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

string
divider

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

string
doktypes

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

mixed
draggable

Specifies whether the element is draggable.

string
dropzone

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.

string
entryLevel

Optional entryLevel TS equivalent of the menu

integer
excludePages

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

mixed
expandAll

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

boolean
forceAbsoluteUrl

If TRUE, the menu will be rendered with absolute URLs

boolean
forceClosingTag

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

boolean
hidden

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

string
hideIfEmpty

Hide the tag completely if there is no tag content

boolean
id

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

string
includeAnchorTitle

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

boolean
includeSpacers

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

boolean
labelFirst

Label for the "first" link

string
labelLast

Label for the "last" link

string
labelNext

Label for the "next" link

string
labelPrevious

Label for the "previous" link

string
labelUp

Label for the "up" link

string
lang

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

string
levels

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

integer
linkActive

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

boolean
linkCurrent

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

boolean
onclick

JavaScript evaluated for the onclick event

string
pageUid

Optional parent page UID to use as top level of menu. If unspecified, current page UID is used

integer
renderFirst

If set to FALSE the "first" link will not be rendered

boolean
renderLast

If set to FALSE the "last" link will not be rendered

boolean
renderUp

If set to FALSE the "up" link will not be rendered

boolean
rootLineAs

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

string
showAccessProtected

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

boolean
showCurrent

If FALSE, does not display the current page

boolean
showHiddenInMenu

Include pages that are set to be hidden in menus

boolean
spellcheck

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

string
style

Individual CSS styles for this element

string
substElementUid

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

boolean
tabindex

Specifies the tab order of this element

integer
tagName

Tag name to use for enclosing container

string
tagNameChildren

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

string
title

Tooltip text of element

string
titleFields

CSV list of fields to use as link label - default is "navtitle,title", change to for example "txmyextsomefield,subtitle,navtitle,title". The first field that contains text will be used. Field value resolved AFTER page field overlays.

string
translate

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.

string
usePageTitles

If set to TRUE, uses target page titles instead of "next", "previous" etc. labels

boolean
useShortcutData

Shortcut to set useShortcutTarget and useShortcutData simultaneously

boolean
useShortcutTarget

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

boolean
useShortcutUid

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.

boolean
Required attribute

Revision history

commit 4e8e0bde9099ac8e352106d647edec79be662dea
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Thu Mar 14 17:06:03 2013 +0100

    [FEATURE] Add browse menu view helper
    
    This view helper adds a browse menu similar to special.browse in TS

commit feb091c8a2351e8ae07e2bb5e7c1bd38ca8c48d4
Author: Claus Due <*****@wildside.dk>
Date:   Sun Mar 17 16:58:11 2013 +0100

    [DOC] Adjust argument descriptions for defaults in Browse Menu ViewHelper

commit 6b0dcbade13cba27074a8f689e80f25ec86174fc
Author: Claus Due <*****@wildside.dk>
Date:   Sun Mar 17 17:15:01 2013 +0100

    [FEATURE] Allow getting title of pages from page record, Browse Menu ViewHelper

commit 1eda8f425a19e95720bfa0ba8df333bcef108b5d
Author: Claus Due <*****@wildside.dk>
Date:   Sat May 4 20:53:07 2013 +0200

    [TASK] Remove unused variables from various Menu ViewHelpers

commit 1094d85a825dc74847a44f3e62fe0390cfd7aad1
Author: Claus Due <*****@wildside.dk>
Date:   Sat May 4 20:53:58 2013 +0200

    [TASK] Cleanup variable backups in various Menu ViewHelpers

commit 9b01aec0f3796dd1f004ad4efee4a7f55624a5ea
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Thu Jun 13 16:57:36 2013 +0200

    [TASK] Adapt changes introduced by deferred rendering

commit 884091d88d756bc3bfb8481ad014f5f64f2e18ea
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Mon Jun 17 15:06:39 2013 +0200

    [BUGFIX] Remove improper use of static property

commit c862632fa9dbcc277b6449532a3abde71d105928
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Mon Jun 17 22:24:35 2013 +0200

    [TASK] Adapt changes in PageSelectService::getRootline()

commit e80849e11b1525590586ea428b67003320392692
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Mon Jun 17 22:42:14 2013 +0200

    [TASK] Adapt changes in PageSelectService

commit c3c7b31021034f86ac4e0f61b312f77a38200957
Author: Claus Due <*****@wildside.dk>
Date:   Sat Jun 22 21:18:15 2013 +0200

    [FEATURE] Attribute "as" on all menu ViewHelpers
    
    Use of this argument allows setting the name of the variable that should contain the menu structure (note: in addition to the "menu" variable).

commit 9b6b53dda952658dc10eaf3748294556226812ee
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Wed Jul 24 18:22:12 2013 +0200

    [TASK] Adapt changes introduced by refactoring

commit ecb5cdfefa4d2fe54e73dfbbad67d5b1a8ac9e35
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Fri Oct 4 14:59:23 2013 +0200

    [BUGFIX] Avoid overwriting of menu items with same page uid

commit da31bad1d9bb058c072ddb5591e8ed907a1ae8e1
Author: Claus Due <*****@namelesscoder.net>
Date:   Tue Dec 31 23:08:37 2013 +0100

    [TASK] Happy new year!

commit 52bd6e41ccfef3d8193b350153912a9716e6a087
Author: Benjamin Rau <*****@codearts.at>
Date:   Tue Apr 1 21:09:00 2014 +0200

    [TASK] CGL compliance

commit da7677bc74f14e9a9300e4ba4487e52c3cb97642
Author: Claus Due <*****@namelesscoder.net>
Date:   Sun Apr 20 01:13:33 2014 +0200

    [TASK] Switch to namespaces

commit c1b0dbe578e79f7123ecad76da8b7334330027be
Author: Claus Due <*****@namelesscoder.net>
Date:   Tue Aug 5 15:19:14 2014 +0200

    [TASK] Add missing attribute pageUid on page.menu.browse

commit 5516227a45aad3a9209b37eed4f5b8343af97444
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Wed Aug 6 20:57:28 2014 +0200

    [BUGFIX] Adapt to changed array indexes

commit c0f86b3fe86f875fa8dd1ef38986351929d65e6e
Author: Björn Fromme <*****@bjo3rn.com>
Date:   Wed Aug 27 10:26:40 2014 +0200

    [TASK] Add argument for current pid

commit 15dc3189ddc990b8c4278e9d07fd48a047b87498
Author: Charles Brunet <*****@gmail.com>
Date:   Tue Nov 4 21:20:43 2014 -0500

    [BUGFIX] Empty menu when usePageTitles is TRUE

commit 8bb2fc5ee124ba19b0a0ab8e061c9a153fc4651f
Author: Xaver Maierhofer <*****@xwissen.info>
Date:   Sun Jan 18 17:56:13 2015 +0100

    [TASK] Reference Copyright to license.md file