diff --git a/Documentation/ContentObjects/Hmenu/Index.rst b/Documentation/ContentObjects/Hmenu/Index.rst index eed18f994..324bde13c 100644 --- a/Documentation/ContentObjects/Hmenu/Index.rst +++ b/Documentation/ContentObjects/Hmenu/Index.rst @@ -9,6 +9,12 @@ HMENU ===== +.. warning:: + This TypoScript object is still available to provide backward compatibility + for old sites. When creating a new menu or refactoring an existing one + always use the `menu data processor `_ + and a Fluid template. + Objects of type HMENU generate hierarchical menus. In a :ref:`FLUIDTEMPLATE ` the HMENU can be used as a DataProcessor called :ref:`MenuProcessor `, which @@ -24,9 +30,6 @@ structured in the page tree, HMENU also allows you to use the menus. These special menus take characteristics of special menu types into account. -.. contents:: - :local: - .. _cobj-hmenu-options: Properties @@ -36,375 +39,189 @@ Properties :display: table :type: -.. _hmenu-number: - -.. confval:: 1, 2, 3, ... - :name: hmenu-array - :type: :ref:`menu object ` - :Default: (no menu) - - For every menu level, that should be rendered, an according entry must - exist. It defines the menu object that should render the menu items on - the according level. 1 is the first level, 2 is the second level, 3 is - the third level and so on. - - **The property "1" is required!** - - The entry 1 for the first level always must exist. All other levels only - will be generated when they are configured. - - **Example:** - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - temp.sidemenu = HMENU - temp.sidemenu.1 = TMENU - temp.sidemenu.1 { - # Configuration of that TMENU here... - } - temp.sidemenu.2 = TMENU - temp.sidemenu.2 { - # Configuration of that TMENU here... - } - temp.sidemenu.3 = TMENU - temp.sidemenu.3 { - # Configuration of that TMENU here... - } - - This creates a menu with up to three levels: Each TMENU level can hold a - different menu configuration. - - TYPO3 offers :ref:`a variety of menu objects `. - - -.. _hmenu-cache-period: - -.. confval:: cache_period - :name: hmenu-cache-period - :type: :ref:`data-type-integer` - - The number of seconds a menu may remain in cache. If this value is not - set, the first available value of the following will be used: - - 1) cache\_timeout of the current page - - 2) config.cache\_period defined globally - - 3) 86400 (= 1 day) - - -.. _hmenu-cache: - -.. confval:: cache - :name: hmenu-cache - :type: :ref:`cache ` - - See :ref:`cache function description ` for details. - - -.. _hmenu-entrylevel: - -.. confval:: entryLevel - :name: hmenu-entryLevel - :type: :ref:`data-type-integer` / :ref:`stdWrap ` - :Default: 0 - - Defines at which level in the rootLine the menu should start. - - Default is "0" which gives us a menu of the very first pages on the - site. - - If the value is < 0, entryLevel is chosen from "behind" in the - rootLine. Thus "-1" is a menu with items from the outermost level, - "-2" is the level before the outermost... - - **Note:** :typoscript:`entryLevel` does not show a menu **of a certain level of pages** - (use :typoscript:`special = directory` for that) - but it means that it will start to be visible **from that level on**. - - So, for example if you build a simple "sitemap" menu like this one: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.10 = HMENU - page.10 { - entryLevel = 4 - 1 = TMENU - 1.wrap =
    |
- 1.NO.wrapItemAndSub =
  • |
  • - 1.expAll = 1 - 2 < .1 - 3 < .2 - 4 < .3 - 5 < .4 - 6 < .5 - 7 < .6 - } - - it will start to be visible from the 4th level (and will contain only the subpages from that level). - Please note also that this affects also the menu generated with :typoscript:`MenuProcessor`. Example: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.10 { - dataProcessing { - 10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor - 10 { - special = list - special.value.field = pages - levels = 7 - entryLevel = 4 - as = menu - expandAll = 1 - titleField = nav_title // title - } - } - } - -.. _hmenu-special: - -.. confval:: special - :name: hmenu-special - :type: *"directory" / "list" / "updated" / "rootline" / "browse" / "keywords" - / "categories" / "language" / "userfunction"* - - Lets you define special types of menus. - - See the section about the :ref:`.special property `! - - -.. _hmenu-special-value: - -.. confval:: special.value - :name: hmenu-special-value - :type: *list of page-uid's* / :ref:`stdWrap ` - - List of page uid's to use for the special menu. What they are used - for depends on the menu type as defined by ".special"; see the - section about the :ref:`.special property `! - - -.. _hmenu-minitems: - -.. confval:: minItems - :name: hmenu-minItems - :type: :ref:`data-type-integer` / :ref:`stdWrap ` - - The minimum number of items in the menu. If the number of pages does - not reach this level, a dummy-page with the title "..." and - uid=[currentpage\_id] is inserted. - - **Note:** Affects all sub menus as well. To set the value for each - menu level individually, set the properties in the menu objects (see - "Common properties" table). - - -.. _hmenu-maxitems: - -.. confval:: maxItems - :name: hmenu-maxItems - :type: :ref:`data-type-integer` / :ref:`stdWrap ` - - The maximum number of items in the menu. Additional items will be - ignored. - - **Note:** Affects all sub menus as well. (See "minItems" for a - notice.) - - -.. _hmenu-begin: - -.. confval:: begin - :name: hmenu-begin - :type: :ref:`data-type-integer` / :ref:`stdWrap ` :ref:`+calc ` + .. _hmenu-number: - The first item in the menu. + .. confval:: 1, 2, 3, ... + :name: hmenu-array + :type: :ref:`menu object ` + :Default: (no menu) - **Example:** + For every menu level, that should be rendered, an according entry must + exist. It defines the menu object that should render the menu items on + the according level. 1 is the first level, 2 is the second level, 3 is + the third level and so on. - This results in a menu, where the first two items are skipped starting - with item number 3: + **The property "1" is required!** - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + The entry 1 for the first level always must exist. All other levels only + will be generated when they are configured. - begin = 3 + TYPO3 offers :ref:`the menu object TMENU `. - **Note:** Affects all sub menus as well. (See "minItems" for a - notice.) + .. _hmenu-cache-period: + .. confval:: cache_period + :name: hmenu-cache-period + :type: :ref:`data-type-integer` -.. _hmenu-excludeuidlist: + The number of seconds a menu may remain in cache. If this value is not + set, the first available value of the following will be used: -.. confval:: excludeUidList - :name: hmenu-excludeUidList - :type: list of :ref:`data-type-integer` / :ref:`stdWrap ` + 1) cache\_timeout of the current page - This is a list of page uids to exclude when the select statement is - done. Comma-separated. You may add "current" to the list to exclude - the current page. + 2) config.cache\_period defined globally - **Example:** + 3) 86400 (= 1 day) - The pages with these uid-numbers will **not** be within the menu! - Additionally the current page is always excluded too. + .. _hmenu-cache: - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + .. confval:: cache + :name: hmenu-cache + :type: :ref:`cache ` - excludeUidList = 34,2,current + See :ref:`cache function description ` for details. + .. _hmenu-entrylevel: -.. _hmenu-excludedoktypes: + .. confval:: entryLevel + :name: hmenu-entryLevel + :type: :ref:`data-type-integer` / :ref:`stdWrap ` + :Default: 0 -.. confval:: excludeDoktypes - :name: hmenu-excludeDoktypes - :type: list of :ref:`data-type-integer` - :Default: 6,254 + Defines at which level in the rootLine the menu should start. - Enter the list of page document types (doktype) to exclude from menus. - By default pages that are "backend user access only" (6) or "folder" - (254) are excluded. + .. _hmenu-special: -.. _hmenu-includenotinmenu: + .. confval:: special + :name: hmenu-special + :type: *"directory" / "list" / "updated" / "rootline" / "browse" / "keywords" + / "categories" / "language" / "userfunction"* -.. confval:: includeNotInMenu - :name: hmenu-includeNotInMenu - :type: :ref:`data-type-boolean` / :ref:`stdWrap ` + Lets you define special types of menus. - If set, pages with the checkbox "Page enabled in menus" disabled will still be included - in menus. + See the section about the :ref:`.special property `! -.. _hmenu-alwaysactivepidlist: + .. _hmenu-special-value: -.. confval:: alwaysActivePIDlist - :name: hmenu-alwaysActivePIDlist - :type: list of :ref:`data-type-integer` /:ref:`stdWrap ` + .. confval:: special.value + :name: hmenu-special-value + :type: *list of page-uid's* / :ref:`stdWrap ` - This is a list of page UID numbers that will always be regarded as - active menu items and thereby automatically opened regardless of the - rootline. + List of page uid's to use for the special menu. What they are used + for depends on the menu type as defined by ".special"; see the + section about the :ref:`.special property `! + .. _hmenu-minitems: -.. _hmenu-protectlvar: + .. confval:: minItems + :name: hmenu-minItems + :type: :ref:`data-type-integer` / :ref:`stdWrap ` -.. confval:: protectLvar - :name: hmenu-protectlvar - :type: :ref:`data-type-boolean` / keyword + The minimum number of items in the menu. If the number of pages does + not reach this level, a dummy-page with the title "..." and + `uid=[currentpage\_id]` is inserted. - If set, then for each page in the menu it will be checked if an - Alternative Page Language record for the language defined in - "config.sys\_language\_uid" exists for the - page. If that is not the case and the pages "Localization settings" - have the "Hide page if no translation for current language exists" - flag set, then the menu item will link to a non accessible page that - will yield an error page to the user. Setting this option will prevent - that situation by adding "&L=0" for such pages, meaning that - they will switch to the default language rather than keeping the - current language. + **Note:** Affects all sub menus as well. To set the value for each + menu level individually, set the properties in the menu objects (see + "Common properties" table). - The check is only carried out if a translation is requested - ("config.sys\_language\_uid" is not zero). + .. _hmenu-maxitems: - **Keyword: "all"** + .. confval:: maxItems + :name: hmenu-maxItems + :type: :ref:`data-type-integer` / :ref:`stdWrap ` - When set to "all" the same check is carried out but it will not look - if "Hide page if no translation for current language exists" is set - - it always reverts to default language if no translation is found. + The maximum number of items in the menu. Additional items will be + ignored. - For these options to make sense, they should only be used when - "config.sys\_language\_mode" is not set to "content\_fallback". + **Note:** Affects all sub menus as well. (See "minItems" for a + notice.) + .. _hmenu-begin: -.. _hmenu-addquerystring: + .. confval:: begin + :name: hmenu-begin + :type: :ref:`data-type-integer` / :ref:`stdWrap ` :ref:`+calc ` -.. confval:: addQueryString - :name: hmenu-addquerystring - :type: :ref:`->addQueryString ` + The first item in the menu. - **Note:** This works only for *special=language*. + **Note:** Affects all sub menus as well. (See "minItems" for a + notice.) + .. _hmenu-excludeuidlist: -.. _hmenu-if: + .. confval:: excludeUidList + :name: hmenu-excludeUidList + :type: list of :ref:`data-type-integer` / :ref:`stdWrap ` -.. confval:: if - :name: hmenu-if - :type: :ref:`->if ` + See :confval:`MenuProcessor-excludeUidList`. - If "if" returns false, the menu is not generated. + .. _hmenu-excludedoktypes: + .. confval:: excludeDoktypes + :name: hmenu-excludeDoktypes + :type: list of :ref:`data-type-integer` + :Default: 6,254 -.. _hmenu-wrap: + See :confval:`MenuProcessor-excludeDoktypes`. -.. confval:: wrap - :name: hmenu-wrap - :type: :ref:`wrap ` / :ref:`stdWrap ` + .. _hmenu-includenotinmenu: - Wrap for the HMENU. + .. confval:: includeNotInMenu + :name: hmenu-includeNotInMenu + :type: :ref:`data-type-boolean` / :ref:`stdWrap ` + See :confval:`MenuProcessor-includeNotInMenu` -.. _hmenu-stdwrap: + .. _hmenu-alwaysactivepidlist: -.. confval:: stdWrap - :name: hmenu-stdWrap - :type: :ref:`->stdWrap ` + .. confval:: alwaysActivePIDlist + :name: hmenu-alwaysActivePIDlist + :type: list of :ref:`data-type-integer` /:ref:`stdWrap ` - (Executed after ".wrap".) + See :confval:`MenuProcessor-alwaysActivePIDlist` + .. _hmenu-protectlvar: -.. _hmenu-examples: + .. confval:: protectLvar + :name: hmenu-protectlvar + :type: :ref:`data-type-boolean` / keyword -Example -======= + See :confval:`MenuProcessor-protectlvar`. -.. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + .. _hmenu-if: - temp.sidemenu = HMENU - temp.sidemenu.entryLevel = 1 - temp.sidemenu.1 = TMENU - temp.sidemenu.1 { - target = page - NO.afterImg = media/bullets/dots2.gif |*||*| _ - NO.afterImgTagParams = style="margin: 0px 20px;" - NO.linkWrap = {$fontTag} - NO.ATagBeforeWrap = 1 + .. confval:: if + :name: hmenu-if + :type: :ref:`->if ` - ACT < .NO - ACT = 1 - ACT.linkWrap = {$fontTag} - } + If "if" returns false, the menu is not generated. + .. _hmenu-wrap: + .. confval:: wrap + :name: hmenu-wrap + :type: :ref:`wrap ` / :ref:`stdWrap ` -.. index:: HMENU; special -.. _hmenu-special-property: + Wrap for the HMENU. -The .special property -===================== + .. _hmenu-stdwrap: -This property makes it possible to create menus that are not strictly -reflecting the current page-structure, but rather creating a -:ref:`breadcrumb menu `, a -:ref:`language menu ` or menus with -links to pages like :ref:`next/previous `, -:ref:`last modified `, -:ref:`all subpages of a page ` and so on. + .. confval:: stdWrap + :name: hmenu-stdWrap + :type: :ref:`->stdWrap ` -.. note:: - :typoscript:`.entryLevel` generally is not supported together with the - :typoscript:`.special` property! The only exception is :typoscript:`special = keywords`. + (Executed after ".wrap".) -Also be aware that this property selects pages for the first level in -the menu. Submenus by menuObjects 2+ will be created as usual. + .. _hmenu-examples: + .. _hmenu-special-property: -See the following menus types based on the :typoscript:`special` property: + For examples on how to use the HMENU please refer to old version of this + document, for example :ref:`HMENU ` -.. toctree:: - :titlesonly: - :glob: + .. toctree:: + :titlesonly: + :glob: + :hidden: - Tmenu/Index - * + Tmenu/Index + * diff --git a/Documentation/ContentObjects/Hmenu/Tmenu/Index.rst b/Documentation/ContentObjects/Hmenu/Tmenu/Index.rst index 7b3ef8f79..42ba8ceb1 100644 --- a/Documentation/ContentObjects/Hmenu/Tmenu/Index.rst +++ b/Documentation/ContentObjects/Hmenu/Tmenu/Index.rst @@ -8,7 +8,14 @@ TMENU ===== -:typoscript:`TMENU` is a menu object type. +.. warning:: + This TypoScript object is still available to provide backward compatibility + for old sites. When creating a new menu or refactoring an existing one + always use the `menu data processor `_ + and a Fluid template. + +For examples on how to use the TMENU please refer to old version of this +document, for example :ref:`TMENU `-. .. toctree:: :glob: @@ -20,16 +27,16 @@ TMENU .. index:: TMENU; Item states -.. _tmenu-common-property-no: -.. _tmenu-common-property-ifsub: -.. _tmenu-common-property-act: -.. _tmenu-common-property-actifsub: -.. _tmenu-common-property-cur: -.. _tmenu-common-property-curifsub: -.. _tmenu-common-property-usr: -.. _tmenu-common-property-spc: -.. _tmenu-common-property-userdef1: -.. _tmenu-common-property-userdef2: +.. _tmenu-common-property-no: +.. _tmenu-common-property-ifsub: +.. _tmenu-common-property-act: +.. _tmenu-common-property-actifsub: +.. _tmenu-common-property-cur: +.. _tmenu-common-property-curifsub: +.. _tmenu-common-property-usr: +.. _tmenu-common-property-spc: +.. _tmenu-common-property-userdef1: +.. _tmenu-common-property-userdef2: .. _tmenu-common-properties: TMENU item states @@ -61,23 +68,6 @@ The following Item states are listed from the least to the highest priority: The default "Normal" state rendering of Item. This is required for all menus. - If you specify properties for the "NO" property you do not have to set - it "1". Otherwise with no properties setting "NO=1" will render the - menu anyways (for TMENU this may make sense). - - The simplest menu TYPO3 can generate is then: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.20 = HMENU - page.20.1 = TMENU - page.20.1.NO = 1 - - That will be pure `` tags wrapped around page titles. - - - .. confval:: IFSUB :name: tmenu-common-property-ifsub :type: :ref:`data-type-boolean` / :ref:`tmenuitem` @@ -85,8 +75,6 @@ The following Item states are listed from the least to the highest priority: Enable/Configuration for menu items which has subpages. - - .. confval:: ACT :name: tmenu-common-property-act :type: :ref:`data-type-boolean` / :ref:`tmenuitem` @@ -107,7 +95,6 @@ The following Item states are listed from the least to the highest priority: :type: :ref:`data-type-boolean` / :ref:`tmenuitem` :Default: 0 - Enable/Configuration for a menu item if the item is the current page. .. confval:: CURIFSUB @@ -236,55 +223,6 @@ Properties tt_content.menu.20.3.1.sectionIndex.useColPos = -1 - - .. rubric:: The data record in sectionIndex menus - - When the menu-records are selected it works like this: The parent page - record is used as the "base" for the menu-record. That means that any - "no\_cache" or "target"-properties of the parent page are used for the - whole menu. - - But of course some fields from the tt\_content records are - transferred. This is how it is mapped: - - .. code-block:: none - :caption: Example of data mapping - - $temp[$row[uid]]=$basePageRow; - $temp[$row[uid]]['title']=$row['header']; - $temp[$row[uid]]['subtitle']=$row['subheader']; - $temp[$row[uid]]['starttime']=$row['starttime']; - $temp[$row[uid]]['endtime']=$row['endtime']; - $temp[$row[uid]]['fe_group']=$row['fe_group']; - $temp[$row[uid]]['media']=$row['media']; - $temp[$row[uid]]['header_layout']=$row['header_layout']; - $temp[$row[uid]]['bodytext']=$row['bodytext']; - $temp[$row[uid]]['image']=$row['image']; - $temp[$row[uid]]['sectionIndex_uid']=$row['uid']; - - Basically this shows that - - - the field "header" and "subheader" from tt\_content are mapped to - "title" and "subtitle" in the pages-record. Thus you shouldn't need to - change your standard menu objects to fit this thing. - - - the fields "starttime", "endtime", "fe\_group", "media" from - tt\_content are mapped to the same fields in a pages-record. - - - the fields "header\_layout", "bodytext" and "image" are mapped to - non-existing fields in the page-record - - - a new field, "sectionIndex\_uid" is introduced in the page record - which is detected by the `\TYPO3\CMS\Frontend\Typolink\PageLinkBuilder`. If this field - is present in a page record, the `PageLinkBuilder` will prepend a - hash-mark and the number of the field. - - .. note:: - You cannot create submenus to sectionIndex menus. These elements are not - pages and thereby have no children. - - - .. confval:: target :name: menu-common-properties-target :type: string @@ -292,8 +230,6 @@ Properties Target of the menu links - - .. confval:: forceTypeValue :name: menu-common-properties-forceTypeValue :type: :ref:`data-type-integer` @@ -309,29 +245,12 @@ Properties Wraps the whole block of sub items. - .. rubric:: Example - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - 2 = TMENU - 2 { - stdWrap.dataWrap =
      |
    - NO { - // ... - } - } - - - .. confval:: wrap :name: menu-common-properties-wrap :type: :ref:`wrap ` Wraps the whole block of sub items, but only if there were items in the menu! - - .. confval:: IProcFunc :name: menu-common-properties-IProcFunc :type: function name @@ -341,7 +260,6 @@ Properties compiled by implode()'ing the array $I[parts] in the passed array. Thus you may modify this if you need to. - .. confval:: alternativeSortingField :name: menu-common-properties-alternativeSortingField :type: :ref:`data-type-string` @@ -351,19 +269,11 @@ Properties is used in the SQL- "ORDER BY" statement instead. You can also provide the sorting order. - **Examples (for "pages" table):** - - alternativeSortingField = title desc - - (This will render the menu in reversed alphabetical order.) - **Limitations:** This property works with normal menus, sectionsIndex menus and special-menus of type "directory". - - .. confval:: minItems :name: menu-common-properties-minItems :type: :ref:`data-type-integer` / :ref:`stdWrap ` @@ -378,34 +288,16 @@ Properties :name: menu-common-properties-maxItems :type: :ref:`data-type-integer` / :ref:`stdWrap ` - The maximum items in the menu. More items will be ignored. Takes precedence over HMENU property :ref:`hmenu-maxitems`. - - .. confval:: begin :name: menu-common-properties-begin :type: :ref:`data-type-integer` / :ref:`stdWrap ` :ref:`+calc ` - The first item in the menu. - **Example:** - - This results in a menu, where the first two items are skipped starting - with item number 3: - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - begin = 3 - - Takes precedence over :HMENU property :ref:`hmenu-begin`. - - - .. confval:: debugItemConf :name: menu-common-properties-debugItemConf :type: :ref:`data-type-boolean` @@ -413,8 +305,6 @@ Properties Outputs (by the :php:`debug()` function) the configuration arrays for each menu item. Useful to debug :ref:`optionsplit` things and such... - - .. confval:: overrideId :name: menu-common-properties-overrideId :type: :ref:`data-type-integer` (page id) @@ -432,17 +322,12 @@ Properties Additional parameter for the menu links. - **Example:** - - "&some\_var=some%20value" - Must be rawurlencoded. .. confval:: showAccessRestrictedPages :name: menu-common-properties-showaccessrestrictedpages :type: :ref:`data-type-integer` (page ID) / keyword "NONE" - If set, pages in the menu will include pages with frontend user group access enabled. However the page is of course not accessible and therefore the URL in the menu will be linked to the page with the ID @@ -466,20 +351,6 @@ Properties **.ATagParams**: Add custom attributes to the anchor tag. - .. rubric:: Example - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - showAccessRestrictedPages = 22 - showAccessRestrictedPages.addParams = &return_url=###RETURN_URL###&pageId=###PAGE_ID### - showAccessRestrictedPages.ATagParams = class="restricted" - - The example will link access restricted menu items to page ID 22 with - the return URL in the GET variable `return_url` and the page ID in the GET - variable "pageId". Additionally, a CSS class "restricted" is added to the - anchor tag. - .. confval:: additionalWhere :name: menu-common-properties-additionalWhere :type: :ref:`data-type-string` / :ref:`stdWrap ` @@ -487,20 +358,10 @@ Properties Adds an additional part to the WHERE clause for this menu. Make sure to start the part with "AND "! - .. rubric:: Example - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - lib.authormenu = HMENU - lib.authormenu.1 = TMENU - lib.authormenu.1.additionalWhere = AND author!="" - .. confval:: itemArrayProcFunc :name: menu-common-properties-itemArrayProcFunc :type: function name - The first variable passed to this function is the "menuArr" array with the menu items as they are collected based on the type of menu. @@ -523,45 +384,4 @@ Properties :name: menu-common-properties-submenuObjSuffixes :type: :ref:`data-type-string` / :ref:`optionsplit` - Defines a suffix for alternative sub-level menu objects. Useful to - create special submenus depending on their parent menu element. See - example below. - - .. rubric:: Example - - This example will generate a menu where the menu objects for the - second level will differ depending on the number of the first level - item for which the submenu is rendered. The second level objects used - are "2" (the default), "2a" and "2b" (the alternatives). Which of them - is used is defined by "1.submenuObjSuffixes" which has the - configuration "a \|\*\| \|\*\| b". This configuration means that the - first menu element will use configuration "2a" and the last will use - "2b" while anything in between will use "2" (no suffix applied) : - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - page.200 = HMENU - page.200 { - 1 = TMENU - 1.wrap =
    |
    - 1.expAll = 1 - 1.submenuObjSuffixes = a |*| |*| b - 1.NO.allWrap = |
    - - 2 = TMENU - 2.NO.allWrap =
    |
    - - 2a = TMENU - 2a.NO.allWrap =
    |
    - - 2b = TMENU - 2b.NO.allWrap =
    |
    - } - - The result can be seen in the image below: - - .. figure:: /Images/ManualScreenshots/FrontendOutput/Hmenu/MenuObjectsCommonPropertiesSubmenuObjSuffixes.png - :alt: Output of the above example. - - Applies to TMENU on >= 2 :sup:`nd` level in a menu. + Defines a suffix for alternative sub-level menu objects. diff --git a/Documentation/ContentObjects/Hmenu/Tmenu/Tmenuitem.rst b/Documentation/ContentObjects/Hmenu/Tmenu/Tmenuitem.rst index fe95e5cac..753e5070a 100644 --- a/Documentation/ContentObjects/Hmenu/Tmenu/Tmenuitem.rst +++ b/Documentation/ContentObjects/Hmenu/Tmenu/Tmenuitem.rst @@ -6,10 +6,21 @@ TMENUITEM ========= +.. warning:: + This TypoScript object is still available to provide backward compatibility + for old sites. When creating a new menu or refactoring an existing one + always use the `menu data processor `_ + and a Fluid template. + +For examples on how to use the TMENUITEM please refer to old version of this +document, for example :ref:`TMENUITEM `-. + The current record is the page record of the menu item. If you would like to get data from the current menu item's page record, use :typoscript:`stdWrap.data = field : [field name]`. +.. _tmenuitem-properties: + Properties ========== @@ -118,13 +129,6 @@ Properties Additional parameters - **Example:** : - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - ATagParams = class="board" - .. _tmenuitem-ATagTitle: @@ -135,16 +139,6 @@ Properties Allows you to specify the "title" attribute of the :html:`
    ` tag around the menu item. - **Example:** : - - .. code-block:: typoscript - :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript - - ATagTitle.field = abstract // description - - This would use the abstract or description field for the - :html:`` attribute. - .. _tmenuitem-additionalParams: diff --git a/Documentation/DataProcessing/Index.rst b/Documentation/DataProcessing/Index.rst index 27e3e7b83..232b8b270 100644 --- a/Documentation/DataProcessing/Index.rst +++ b/Documentation/DataProcessing/Index.rst @@ -27,7 +27,7 @@ for example for comma-separated values, related files or related records. FlexFormProcessor GalleryProcessor LanguageMenuProcessor - MenuProcessor + MenuProcessor/Index PageContentFetchingProcessor RecordTransformationProcessor SiteProcessor diff --git a/Documentation/DataProcessing/MenuProcessor.rst b/Documentation/DataProcessing/MenuProcessor.rst deleted file mode 100644 index 6864c7908..000000000 --- a/Documentation/DataProcessing/MenuProcessor.rst +++ /dev/null @@ -1,120 +0,0 @@ -:navigation-title: menu -.. include:: /Includes.rst.txt -.. _MenuProcessor: - -===================== -`menu` data processor -===================== - -The :php:`\TYPO3\CMS\Frontend\DataProcessing\MenuProcessor`, -alias `menu`, utilizes :ref:`HMENU ` to generate a list -of menu items which can be assigned to :typoscript:`FLUIDTEMPLATE` as a -variable. - -Additional data processing is supported and will be applied to each record. - -.. contents:: Table of contents - -.. hint:: - The third party extension `b13/menus - `__ also provides menu - processors like :php:`\B13\Menus\DataProcessing\TreeMenu` and - :php:`\B13\Menus\DataProcessing\BreadcrumbsMenu`. - - Refer to the `manual of the extension b13/menus - `__ for more - information. - -.. _MenuProcessor-options: - -Options -======= - -.. confval-menu:: - :display: table - :type: - :Default: - - .. _MenuProcessor-levels: - - .. confval:: levels - :name: MenuProcessor-levels - :Required: true - :type: :ref:`data-type-integer` / :ref:`stdWrap` - :Default: 1 - :Example: 5 - - Maximal number of levels to be included in the output array. - - .. _MenuProcessor-expandAll: - - .. confval:: expandAll - :name: MenuProcessor-expandAll - :Required: true - :type: :ref:`data-type-boolean` / :ref:`stdWrap` - :Default: 1 - :Example: 0 - - Include all submenus (`1`) or only those of the active pages (`0`). - - .. _MenuProcessor-includeSpacer: - - .. confval:: includeSpacer - :name: MenuProcessor-includeSpacer - :Required: true - :type: :ref:`data-type-boolean` / :ref:`stdWrap` - :Default: 0 - :Example: 1 - - Include pages with type "spacer". - - .. _MenuProcessor-titleField: - - .. confval:: titleField - :name: MenuProcessor-titleField - :Required: true - :type: :ref:`data-type-string` / :ref:`stdWrap` - :Default: "nav_title // title" - :Example: "subtitle" - - Fields to be used as title. - - - .. _MenuProcessor-as: - - .. confval:: as - :name: MenuProcessor-as - :Required: false - :type: :ref:`data-type-string` - :Default: "menu" - - Name for the variable in the Fluid template. - - .. hint:: - Additionally, all :ref:`HMENU options ` are available. - -.. _MenuProcessor-example-two-levels: - -Example: Two level menu of the web page -======================================= - -Please see also :ref:`dataProcessing-about-examples`. - -.. rubric:: TypoScript - -Using the :php:`MenuProcessor` the following scenario is possible: - -.. include:: /CodeSnippets/DataProcessing/TypoScript/MenuProcessor.rst.txt - -.. rubric:: The Fluid template - -This generated menu can be used in Fluid like this: - -.. include:: /CodeSnippets/DataProcessing/Template/DataProcMenu.rst.txt - -.. rubric:: Output - -The array now contains the menu items on level one. Each item in return has the -menu items of level 2 in an array called :php:`children`. - -.. include:: /Images/AutomaticScreenshots/DataProcessing/MenuProcessor.rst.txt diff --git a/Documentation/ContentObjects/Hmenu/Browse.rst b/Documentation/DataProcessing/MenuProcessor/Browse.rst similarity index 99% rename from Documentation/ContentObjects/Hmenu/Browse.rst rename to Documentation/DataProcessing/MenuProcessor/Browse.rst index a6fa53a8b..a4cd6fb51 100644 --- a/Documentation/ContentObjects/Hmenu/Browse.rst +++ b/Documentation/DataProcessing/MenuProcessor/Browse.rst @@ -1,5 +1,5 @@ +:navigation-title: Browse .. include:: /Includes.rst.txt -.. index:: HMENU; special = browse .. _hmenu-special-browse: ================================ diff --git a/Documentation/ContentObjects/Hmenu/Categories.rst b/Documentation/DataProcessing/MenuProcessor/Categories.rst similarity index 98% rename from Documentation/ContentObjects/Hmenu/Categories.rst rename to Documentation/DataProcessing/MenuProcessor/Categories.rst index 0d4c03b9b..e80bceb5a 100644 --- a/Documentation/ContentObjects/Hmenu/Categories.rst +++ b/Documentation/DataProcessing/MenuProcessor/Categories.rst @@ -1,11 +1,12 @@ +:navigation-title: Categories .. include:: /Includes.rst.txt .. index:: HMENU; special = categories .. _hmenu-special-categories: -================ -Categories HMENU -================ +========== +Categories +========== Makes a menu of pages belonging to one or more categories. If a page belongs to several of the selected categories, it will appear only once. diff --git a/Documentation/ContentObjects/Hmenu/Directory.rst b/Documentation/DataProcessing/MenuProcessor/Directory.rst similarity index 98% rename from Documentation/ContentObjects/Hmenu/Directory.rst rename to Documentation/DataProcessing/MenuProcessor/Directory.rst index 72199c217..b28218068 100644 --- a/Documentation/ContentObjects/Hmenu/Directory.rst +++ b/Documentation/DataProcessing/MenuProcessor/Directory.rst @@ -1,3 +1,4 @@ +:navigation-title: Directory .. include:: /Includes.rst.txt .. index:: HMENU; special = directory .. _hmenu-special-directory: diff --git a/Documentation/DataProcessing/MenuProcessor/Index.rst b/Documentation/DataProcessing/MenuProcessor/Index.rst new file mode 100644 index 000000000..fde8220c9 --- /dev/null +++ b/Documentation/DataProcessing/MenuProcessor/Index.rst @@ -0,0 +1,238 @@ +:navigation-title: menu +.. include:: /Includes.rst.txt +.. _MenuProcessor: + +===================== +`menu` data processor +===================== + +The :php:`\TYPO3\CMS\Frontend\DataProcessing\MenuProcessor`, +alias `menu`, utilizes :ref:`HMENU ` to generate a list +of menu items which can be assigned to :typoscript:`FLUIDTEMPLATE` as a +variable. + +Additional data processing is supported and will be applied to each record. + +.. contents:: Table of contents + +.. hint:: + The third party extension `b13/menus + `__ also provides menu + processors like :php:`\B13\Menus\DataProcessing\TreeMenu` and + :php:`\B13\Menus\DataProcessing\BreadcrumbsMenu`. + + Refer to the `manual of the extension b13/menus + `__ for more + information. + +.. _MenuProcessor-options: + +Options +======= + +.. confval-menu:: + :display: table + :type: + :Default: + + .. _MenuProcessor-as: + + .. confval:: as + :name: MenuProcessor-as + :Required: false + :type: :ref:`data-type-string` + :Default: "menu" + + Name for the variable in the Fluid template. + + .. confval:: alwaysActivePIDlist + :name: MenuProcessor-alwaysActivePIDlist + :type: list of :ref:`data-type-integer` /:ref:`stdWrap ` + + This is a list of page UID numbers that will always be regarded as + active menu items and thereby automatically opened regardless of the + rootline. + + .. confval:: entryLevel + :name: MenuProcessor-entryLevel + :type: :ref:`data-type-integer` / :ref:`stdWrap ` + :Default: 0 + + Defines at which level in the rootLine the menu should start. + + Default is "0" which gives us a menu of the very first pages on the + site. + + If the value is < 0, entryLevel is chosen from "behind" in the + rootLine. Thus "-1" is a menu with items from the outermost level, + "-2" is the level before the outermost... + + **Note:** :typoscript:`entryLevel` does not show a menu **of a certain level of pages** + (use :typoscript:`special = directory` for that) + but it means that it will start to be visible **from that level on**. + + So, for example if you build a simple "sitemap" menu like this one: + + .. literalinclude:: _code-snippets/_entryLevel.typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + it will start to be visible from the 4th level (and will contain only + the subpages from that level). + + .. confval:: excludeDoktypes + :name: MenuProcessor-excludeDoktypes + :type: list of :ref:`data-type-integer` + :Default: 6,254 + + Enter the list of page document types (doktype) to exclude from menus. + By default pages that are "backend user access only" (6) or "folder" + (254) are excluded. + + .. confval:: excludeUidList + :name: MenuProcessor-excludeUidList + :type: list of :ref:`data-type-integer` / :ref:`stdWrap ` + + This is a list of page uids to exclude when the select statement is + done. Comma-separated. You may add "current" to the list to exclude + the current page. + + **Example:** + + The pages with these uid-numbers will **not** be within the menu! + Additionally the current page is always excluded too. + + .. code-block:: typoscript + :caption: EXT:site_package/Configuration/TypoScript/setup.typoscript + + page.10.dataProcessing.20.excludeUidList = 34,2,current + + .. _MenuProcessor-expandAll: + + .. confval:: expandAll + :name: MenuProcessor-expandAll + :Required: true + :type: :ref:`data-type-boolean` / :ref:`stdWrap` + :Default: 1 + :Example: 0 + + Include all submenus (`1`) or only those of the active pages (`0`). + + .. _MenuProcessor-levels: + + .. confval:: levels + :name: MenuProcessor-levels + :Required: true + :type: :ref:`data-type-integer` / :ref:`stdWrap` + :Default: 1 + :Example: 5 + + Maximal number of levels to be included in the output array. + + .. confval:: includeNotInMenu + :name: MenuProcessor-includeNotInMenu + :type: :ref:`data-type-boolean` / :ref:`stdWrap ` + + If set, pages with the checkbox "Page enabled in menus" disabled will still be included + in menus. + + .. _MenuProcessor-includeSpacer: + + .. confval:: includeSpacer + :name: MenuProcessor-includeSpacer + :Required: true + :type: :ref:`data-type-boolean` / :ref:`stdWrap` + :Default: 0 + :Example: 1 + + Include pages with type "spacer". + + .. confval:: protectLvar + :name: MenuProcessor-protectlvar + :type: :ref:`data-type-boolean` / keyword + + If set, then for each page in the menu it will be checked if an + Alternative Page Language record for the language defined in + the site exists for the + page. If that is not the case and the pages "Localization settings" + have the "Hide page if no translation for current language exists" + flag set, then the menu item will link to a non accessible page that + will yield an error page to the user. Setting this option will prevent + that situation by adding "&L=0" for such pages, meaning that + they will switch to the default language rather than keeping the + current language. + + The check is only carried out if a translation is requested, not for the + standard language. + + **Keyword: "all"** + + When set to "all" the same check is carried out but it will not look + if "Hide page if no translation for current language exists" is set - + it always reverts to default language if no translation is found. + + .. confval:: special + :name: MenuProcessor-special + :type: *"directory" / "list" / "updated" / "rootline" / "browse" / "keywords" + / "categories" / "language" / "userfunction"* + + Lets you define special types of menus. + + See the section about the :ref:`.special property `! + + .. confval:: value + :name: MenuProcessor-special-value + :type: *list of page-uid's* / :ref:`stdWrap ` + + List of page uid's to use for the special menu. What they are used + for depends on the menu type as defined by ".special"; see the + section about the :ref:`.special property `! + + .. _MenuProcessor-titleField: + + .. confval:: titleField + :name: MenuProcessor-titleField + :Required: true + :type: :ref:`data-type-string` / :ref:`stdWrap` + :Default: "nav_title // title" + :Example: "subtitle" + + Fields to be used as title. + +.. _MenuProcessor-special: + +Special menu types +================== + +The following special menu types are available: + +.. toctree:: + :glob: + :titlesonly: + + * + +.. _MenuProcessor-example-two-levels: + +Example: Two level menu of the web page +======================================= + +Please see also :ref:`dataProcessing-about-examples`. + +.. rubric:: TypoScript + +Using the :php:`MenuProcessor` the following scenario is possible: + +.. include:: /CodeSnippets/DataProcessing/TypoScript/MenuProcessor.rst.txt + +.. rubric:: The Fluid template + +This generated menu can be used in Fluid like this: + +.. include:: /CodeSnippets/DataProcessing/Template/DataProcMenu.rst.txt + +.. rubric:: Output + +The array now contains the menu items on level one. Each item in return has the +menu items of level 2 in an array called :php:`children`. + +.. include:: /Images/AutomaticScreenshots/DataProcessing/MenuProcessor.rst.txt diff --git a/Documentation/ContentObjects/Hmenu/Keywords.rst b/Documentation/DataProcessing/MenuProcessor/Keywords.rst similarity index 99% rename from Documentation/ContentObjects/Hmenu/Keywords.rst rename to Documentation/DataProcessing/MenuProcessor/Keywords.rst index bbcc89fbf..b06ec563a 100644 --- a/Documentation/ContentObjects/Hmenu/Keywords.rst +++ b/Documentation/DataProcessing/MenuProcessor/Keywords.rst @@ -1,3 +1,4 @@ +:navigation-title: Keywords .. include:: /Includes.rst.txt .. index:: HMENU; special = keywords .. _hmenu-special-keywords: diff --git a/Documentation/ContentObjects/Hmenu/Language.rst b/Documentation/DataProcessing/MenuProcessor/Language.rst similarity index 91% rename from Documentation/ContentObjects/Hmenu/Language.rst rename to Documentation/DataProcessing/MenuProcessor/Language.rst index 0cd6f3250..d50d4e87c 100644 --- a/Documentation/ContentObjects/Hmenu/Language.rst +++ b/Documentation/DataProcessing/MenuProcessor/Language.rst @@ -1,3 +1,4 @@ +:navigation-title: Language .. include:: /Includes.rst.txt .. index:: HMENU; special = categories .. _hmenu-special-language: @@ -47,6 +48,14 @@ Properties If set, the button for a language will be rendered as a non- disabled button even if no translation is found for the language. +.. _hmenu-addquerystring: + +.. confval:: addQueryString + :name: hmenu-addquerystring + :type: :ref:`->addQueryString ` + + **Note:** This works only for *special=language*. + .. _hmenu-special-language-examples: diff --git a/Documentation/ContentObjects/Hmenu/List.rst b/Documentation/DataProcessing/MenuProcessor/List.rst similarity index 98% rename from Documentation/ContentObjects/Hmenu/List.rst rename to Documentation/DataProcessing/MenuProcessor/List.rst index 69ae4c7d6..f168a9b59 100644 --- a/Documentation/ContentObjects/Hmenu/List.rst +++ b/Documentation/DataProcessing/MenuProcessor/List.rst @@ -1,3 +1,4 @@ +:navigation-title: List .. include:: /Includes.rst.txt .. index:: HMENU; special = list .. _hmenu-special-list: diff --git a/Documentation/ContentObjects/Hmenu/Rootline.rst b/Documentation/DataProcessing/MenuProcessor/Rootline.rst similarity index 98% rename from Documentation/ContentObjects/Hmenu/Rootline.rst rename to Documentation/DataProcessing/MenuProcessor/Rootline.rst index 43c2f222b..7986d37d7 100644 --- a/Documentation/ContentObjects/Hmenu/Rootline.rst +++ b/Documentation/DataProcessing/MenuProcessor/Rootline.rst @@ -1,3 +1,4 @@ +:navigation-title: Rootline / Breadcrumb .. include:: /Includes.rst.txt .. index:: HMENU; special = rootline .. _hmenu-special-rootline: diff --git a/Documentation/ContentObjects/Hmenu/Updated.rst b/Documentation/DataProcessing/MenuProcessor/Updated.rst similarity index 99% rename from Documentation/ContentObjects/Hmenu/Updated.rst rename to Documentation/DataProcessing/MenuProcessor/Updated.rst index 1a2bfbaef..0b6670e56 100644 --- a/Documentation/ContentObjects/Hmenu/Updated.rst +++ b/Documentation/DataProcessing/MenuProcessor/Updated.rst @@ -1,3 +1,4 @@ +:navigation-title: Updated .. include:: /Includes.rst.txt .. index:: HMENU; special = updated .. _hmenu-special-updated: diff --git a/Documentation/ContentObjects/Hmenu/Userfunction.rst b/Documentation/DataProcessing/MenuProcessor/Userfunction.rst similarity index 68% rename from Documentation/ContentObjects/Hmenu/Userfunction.rst rename to Documentation/DataProcessing/MenuProcessor/Userfunction.rst index 99f0fe42d..83befa48f 100644 --- a/Documentation/ContentObjects/Hmenu/Userfunction.rst +++ b/Documentation/DataProcessing/MenuProcessor/Userfunction.rst @@ -1,6 +1,8 @@ +:navigation-title: Userfunction .. include:: /Includes.rst.txt .. index:: HMENU; special = userfunction .. _hmenu-special-userfunction: +.. _hmenu-special-userfunction-examples: ================= Userfunction menu @@ -24,10 +26,6 @@ page records for the menu. Properties ========== -.. confval-menu:: - :display: table - :type: - .. _hmenu-special-userfunction-userfunc: .. confval:: special.userFunc @@ -35,17 +33,3 @@ Properties :type: string Name of the user function - -.. _hmenu-special-userfunction-examples: - -Example: Set a userFunc -======================= - -.. code-block:: typoscript - :caption: This is still possible for backward compability reasons but not recommended: - - lib.custommenu = HMENU - lib.custommenu { - special = userfunction - special.userFunc = MyVendor\MyExtension\Userfuncs\CustomMenu->makeMenuArray - } diff --git a/Documentation/ContentObjects/Hmenu/_code-snippets/_BreadcrumbDataProcessor.typoscript b/Documentation/DataProcessing/MenuProcessor/_code-snippets/_BreadcrumbDataProcessor.typoscript similarity index 100% rename from Documentation/ContentObjects/Hmenu/_code-snippets/_BreadcrumbDataProcessor.typoscript rename to Documentation/DataProcessing/MenuProcessor/_code-snippets/_BreadcrumbDataProcessor.typoscript diff --git a/Documentation/ContentObjects/Hmenu/_code-snippets/_BreadcrumbLib.typoscript b/Documentation/DataProcessing/MenuProcessor/_code-snippets/_BreadcrumbLib.typoscript similarity index 100% rename from Documentation/ContentObjects/Hmenu/_code-snippets/_BreadcrumbLib.typoscript rename to Documentation/DataProcessing/MenuProcessor/_code-snippets/_BreadcrumbLib.typoscript diff --git a/Documentation/ContentObjects/Hmenu/_code-snippets/_LanguageMenuLib.typoscript b/Documentation/DataProcessing/MenuProcessor/_code-snippets/_LanguageMenuLib.typoscript similarity index 100% rename from Documentation/ContentObjects/Hmenu/_code-snippets/_LanguageMenuLib.typoscript rename to Documentation/DataProcessing/MenuProcessor/_code-snippets/_LanguageMenuLib.typoscript diff --git a/Documentation/ContentObjects/Hmenu/_code-snippets/_RelPrevNextMenu.typoscript b/Documentation/DataProcessing/MenuProcessor/_code-snippets/_RelPrevNextMenu.typoscript similarity index 100% rename from Documentation/ContentObjects/Hmenu/_code-snippets/_RelPrevNextMenu.typoscript rename to Documentation/DataProcessing/MenuProcessor/_code-snippets/_RelPrevNextMenu.typoscript diff --git a/Documentation/DataProcessing/MenuProcessor/_code-snippets/_entryLevel.typoscript b/Documentation/DataProcessing/MenuProcessor/_code-snippets/_entryLevel.typoscript new file mode 100644 index 000000000..389273d07 --- /dev/null +++ b/Documentation/DataProcessing/MenuProcessor/_code-snippets/_entryLevel.typoscript @@ -0,0 +1,14 @@ +page.10 { + dataProcessing { + 10 = menu + 10 { + special = list + special.value.field = pages + levels = 7 + entryLevel = 4 + as = menu + expandAll = 1 + titleField = nav_title // title + } + } +} diff --git a/Documentation/Images/ManualScreenshots/FrontendOutput/Hmenu/MenuObjectsCommonPropertiesSubmenuObjSuffixes.png b/Documentation/Images/ManualScreenshots/FrontendOutput/Hmenu/MenuObjectsCommonPropertiesSubmenuObjSuffixes.png deleted file mode 100644 index 2e5ceb489..000000000 Binary files a/Documentation/Images/ManualScreenshots/FrontendOutput/Hmenu/MenuObjectsCommonPropertiesSubmenuObjSuffixes.png and /dev/null differ