These properties are in common for all menu objects if not otherways stated!
Property: | Data type: | Description: | Default: |
|---|---|---|---|
sectionIndex | (see below) | ||
alternativeSortingField | Normally the menuitems are sorted by the fields "sorting" in the pages- and tt_content-table. Here you can enter a list of fields that is used in the SQL- "ORDER BY" statement instead. 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". | ||
minItems | int | The minimum 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. Takes precedence over HMENU.minItems | |
maxItems | int | The maximum items in the menu. More items will be ignored. Takes precedence over HMENU.maxItems | |
begin | int +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: begin = 3 Takes precedence over HMENU.begin | |
JSWindow | boolean | If set, the links of the menu-items will open by JavaScript in a pop-up window. .newWindow boolean, that lets every menuitem open in its own window opposite to opening in the same window for each click. .params is the list of parameters sent to the JavaScript open-window function, eg: width=200,height=300,status=0,menubar=0 NOTE: Does not work with JSMENU's | |
imgNamePrefix | string | prefix for the imagenames. This prefix is appended with the uid of the page. | "img" |
imgNameNotRandom | boolean | If set, the image names of menuitems is not randomly assigned. Usefull switch if you're manipulating these images with some external JavaScript NOTE: Don't set this if you're working with a menu with sectionIndex! In that case you need special unique names of items based on something else than the uid of the parent page of course! | |
debugItemConf | Outputs (by the debug()-function) the configuration arrays for each menuitem. Useful to debug optionSplit things and such... Applies to GMENU, TMENU, IMGMENU | ||
overrideId | integer (page-id) | If set, then all links in the menu will point to this pageid. Instead the real uid of the page is sent by the parameter "&real_uid=[uid]". This feature is smart, if you have inserted a menu from somewhere else, perhaps a shared menu, but wants the menuitems to call the same page, which then generates a proper output based on the real_uid. Applies to GMENU, TMENU, IMGMENU | |
addParams | string | Additional parameter for the menu-links. Example: "&some_var=some%20value" Must be rawurlencoded. Applies to GMENU, TMENU, IMGMENU | |
showAccessRestrictedPages | 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 of this value. On that page you could put a login form or other message. If the value is “NONE” the link will not be changed and the site will perform page-not-found handling when clicked (which can be used to capture the event and act accordingly of course). Properties: .addParam = Additional parameter for the URL, which can hold two markers; ###RETURN_URL### which will be substituted with the link the page would have had if it had been accessible and ###PAGE_ID### holding the page id of the page coming from (could be used to look up which fe_groups was required for access. Example: showAccessRestrictedPages = 22 showAccessRestrictedPages.addParams = &return_url=###RETURN_URL###&pageId=###PAGE_ID### The example will link access restricted menu items to page id 22 with the return URL in the GET var “return_url” and the page id in the GET var “pageId”. | |
itemArrayProcFunc | function-name | The first variable passed to this function is the “menuArr” array with the menuitems as they are collected based on the type of menu. You're free to manipulate or add to this array as you like. Just remember to return the array again! Note: .parentObj property is hardcoded to be a reference to the calling tslib_menu object. Here you'll find eg. ->id to be the uid of the menu item generating a submenu and such. Presetting element state You can override element states like SPC, IFSUB, ACT, CUR or USR by setting the key ITEM_STATE in the page records. See cObject HMENU/special=userdefined for more information. | |
submenuObjSuffixes | string +optionSplit | Defines a suffix for alternative sub-level menu objects. Useful to create special submenus depending on their parent menu element. See example below. 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) page.200 = HMENU page.200 {1 = TMENU 1.wrap = <div style="width:200px; border: 1px solid;">|</div> 1.expAll = 1 1.submenuObjSuffixes = a |*| |*| b 1.NO.allWrap = <b>|</b><br/> 2 = TMENU 2.NO.allWrap = <div style="background:red;">|</div> 2a = TMENU 2a.NO.allWrap = <div style="background:yellow;">|</div> 2b = TMENU 2b.NO.allWrap = <div style="background:green;">|</div> } The result can be seen in the image below (applied on the testsite package):
Applies to GMENU, TMENU, GMENU_LAYERS, TMENU_LAYERS and GMENU_FOLDOUT on >= 2nd level in a menu. |
[tsref:(cObject).HMENU.(mObj)]