{"id":21277920,"url":"https://github.com/b13/menus","last_synced_at":"2025-05-16T13:05:01.832Z","repository":{"id":36307570,"uuid":"217379984","full_name":"b13/menus","owner":"b13","description":"TYPO3 Extension for creating fast menus in a fast fashion","archived":false,"fork":false,"pushed_at":"2025-02-18T06:46:44.000Z","size":227,"stargazers_count":55,"open_issues_count":7,"forks_count":23,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-04-03T08:12:03.383Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-24T19:33:13.000Z","updated_at":"2025-02-28T16:23:27.000Z","dependencies_parsed_at":"2024-06-19T20:02:04.496Z","dependency_job_id":"c113e834-5d64-4f4a-8a1f-db8bcb46d3de","html_url":"https://github.com/b13/menus","commit_stats":{"total_commits":93,"total_committers":23,"mean_commits":4.043478260869565,"dds":0.5698924731182795,"last_synced_commit":"355780fbc03c5c7e302c5c51b563da28897494bd"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fmenus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fmenus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fmenus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b13%2Fmenus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b13","download_url":"https://codeload.github.com/b13/menus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525773,"owners_count":21118750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T10:08:16.098Z","updated_at":"2025-04-12T06:21:29.717Z","avatar_url":"https://github.com/b13.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI](https://github.com/b13/menus/actions/workflows/ci.yml/badge.svg)\n\n# Menus - A TYPO3 Extension for creating fast menus - in a fast way\n\n## Introduction\n\nTYPO3 CMS is known for handling large websites with lots of content. TYPO3 Core provides several ways to build\nnavigation / menus in a very flexible way. However, generating menus has been a tedious issue in most of our\nlarge-scale projects. With TYPO3 v9, the performance of generating menus improved when it comes to URL generation,\nbut a few conceptual issues within linking and menu generation still exist:\n\n1. All logic relies on HMENU\n\n   Every menu is generated using HMENU, even the MenuDataProcessor for Fluid is using this. Yes, it's powerful, but also\n   offers a lot of options we do not need in most circumstances.\n\n2. HMENU saves states for each page\n\n   HMENU offers the possibility to define A LOT of states (\"active\", \"current\", \"has children\"). This information is\n   different for each page - obviously - which is then cached in a separate cache entry in `cache_hash` - making\n   the cache entries fairly large even though we do not use states.\n\n   We use `expAll` (expand all subpages for all other pages as well) which makes the requests to the pages\n   enormously large.\n\n3. HMENU has a cryptic syntax for \"special\" menus\n\n    Nowadays, it is fairly common to build menus for footer navigation, mega-menus, sitemap-like menus for an additional\n    sidebar. Using \"special.\" for language menus, for \"directories\" or just a simple list of pages, seems rather complex.\n\n\nThis extension tries to overcome these pitfalls by\n * building menus once, then caches the results and afterwards applying active states (reduce amount of cached data).\n   This is especially important for Tree-based menus,\n * introducing new cObjects and DataProcessors for the specific use cases making them more understandable for\n   non-TYPO3-Gurus.\n\n## Installation \u0026 Requirements\n\nUse `composer req b13/menus` or install it via TYPO3's Extension Manager from the\n[TYPO3 Extension Repository](https://extensions.typo3.org) using the extension key `menus`.\n\nYou need TYPO3 v9 with Site Handling for this extension to work. If your project supports mount points,\nthis is not implemented. In addition, pages to access restricted pages (even though no access exists) are not yet\nconsidered.\n\n## Features\n\nThe extension ships TypoScript cObjects and TypoScript DataProcessors for Fluid-based page templates.\n\n### Common Options for all menus\n\n* excludePages - a list of page IDs (and their subpages if Tree Menu or Breadcrumbs is used) to exclude from the page\n* excludeDoktypes - a list of doktypes that are not rendered. BE_USER_SECTIONs are excluded by default. SYS_FOLDERs are queried (for subpages etc) but never rendered.\n* includeNotInMenu - include pages with nav_hide set to 1, instead of ignoring them\n\n### Common options for items\n\nIn TypoScript this is available as `field:isSpacer`, in Fluid, this is accessible in `{page.isSpacer}`\n\n    - {page.isCurrentPage} (bool)\n    - {page.isInRootLine} (bool)\n    - {page.isSpacer} (bool)\n    - {page.hasSubpages} (bool) - TreeMenu only\n    - {page.subpages} (array) - TreeMenu only\n\n### Tree Menu\n\nUse this for mega menus, or separate menus for mobile devices, like sitemaps.\n\nPure TypoScript-based solution:\n\n    page.10 = TREEMENU\n    # a list of page IDs, rootpageID is used if none given\n    page.10.entryPoints = 23,13\n    # the number of levels to fetch from the database (1 if empty)\n    page.10.depth = 3\n    page.10.excludePages = 4,51\n    # 0: default, 1 to include nav_hide = 1 pages\n    page.10.includeNotInMenu = 0\n    page.10.renderObj.level0 = TEXT\n    page.10.renderObj.level0.typolink.parameter.data = field:uid\n    page.10.renderObj.level0.typolink.ATagParams = class=\"active\"\n    page.10.renderObj.level0.typolink.ATagParams.if.isTrue.field = isInRootLine\n    page.10.renderObj.level0.dataWrap = \u003cli class=\"firstLevel\"\u003e|\u003cul\u003e{field:subpageContent}\u003c/ul\u003e\u003c/li\u003e\n\nFluid-based solution:\n\n    page.10 = FLUIDTEMPLATE\n    page.10.dataProcessing.10 = B13\\Menus\\DataProcessing\\TreeMenu\n    page.10.dataProcessing.10.entryPoints = 23,13\n    page.10.dataProcessing.10.depth = 3\n    page.10.dataProcessing.10.excludePages = 4,51\n    # 0: default, 1 to include nav_hide = 1 pages\n    page.10.dataProcessing.10.includeNotInMenu = 0\n    page.10.dataProcessing.10.as = mobilemenu\n\nUsage in Fluid:\n\n    \u003cnav\u003e\n        \u003cf:for each=\"{mobilemenu}\" as=\"page\"\u003e\n            \u003cf:link.page pageUid=\"{page.uid}\"\u003e{page.nav_title}\u003c/f:link.page\u003e\n            \u003cf:if condition=\"{page.hasSubpages} \u0026\u0026 {page.isInRootLine}\"\u003e\n                \u003cul\u003e\n                    \u003cf:for each=\"{page.subpages}\" as=\"subpage\"\u003e\n                        \u003cli\u003e\u003cf:link.page pageUid=\"{subpage.uid}\"\u003e{subpage.nav_title}\u003c/f:link.page\u003e\n                    \u003c/f:for\u003e\n                \u003c/ul\u003e\n            \u003c/f:if\u003e\n        \u003c/f:for\u003e\n    \u003c/nav\u003e\n\n**Note**: nav_title is title if Database-Record nav_title is empty.\n\n### Language Menu\n\nBuilding a language switcher can be achieved by a few lines of code:\n\nPure TypoScript solution:\n\n    page.10 = LANGUAGEMENU\n    page.10.excludeLanguages = de,en\n    # 0: default, 1 to include nav_hide = 1 pages\n    page.10.includeNotInMenu = 0\n    # add all siteLanguages to menu even if page is not available in language (default 0)\n    page.10.addAllSiteLanguages = 1\n    page.10.wrap = \u003cul\u003e | \u003c/ul\u003e\n    page.10.renderObj.typolink.parameter.data = field:uid\n    page.10.renderObj.typolink.additionalParams.data = field:language|languageId\n    page.10.renderObj.typolink.additionalParams.intval = 1\n    page.10.renderObj.typolink.additionalParams.wrap = \u0026L=|\n    page.10.renderObj.data = field:language|title // field:language|twoLetterIsoCode\n    page.10.renderObj.wrap = \u003cli class=\"language-item\"\u003e | \u003c/li\u003e\n\nThe stdWrap `data` is the information of the current page plus the information merged from the selected SiteLanguage.\n\nFluid-based solution:\n\n    page.10 = FLUIDTEMPLATE\n    page.10.dataProcessing.10 = B13\\Menus\\DataProcessing\\LanguageMenu\n    page.10.dataProcessing.10.excludeLanguages = de,en\n    # 0: default, 1 to include nav_hide = 1 pages\n    page.10.dataProcessing.10.includeNotInMenu = 0\n    # add all siteLanguages to menu even if page is not available in language (default 0)\n    page.10.dataProcessing.10.addAllSiteLanguages = 1\n    page.10.dataProcessing.10.as = languageswitcher\n\nUsage in Fluid:\n\n    \u003cnav\u003e\n        \u003cf:for each=\"{languageswitcher}\" as=\"item\"\u003e\n            \u003cf:link.page pageUid=\"{item.uid}\" language=\"{item.language.languageId}\"\u003e{item.language.title}\u003c/f:link.page\u003e\n        \u003c/f:for\u003e\n    \u003c/nav\u003e\n\n**Note**: the languageMenu hold the siteLanguage on each item in the `language` property as an array\n\n### List Menu\n\nIf you just want a list of all items within a folder, or for a link list in the footer, use the List Menu.\n\nPure TypoScript-based solution:\n\n    page.10 = LISTMENU\n    # a page ID, rootpageID is used if none given, stdWrap possible\n    page.10.pages = 13,14,15\n    # 0: default, 1 to include nav_hide = 1 pages\n    page.10.includeNotInMenu = 0\n    page.10.wrap = \u003cul\u003e | \u003c/ul\u003e\n    page.10.renderObj = TEXT\n    page.10.renderObj.typolink.parameter.data = field:uid\n    page.10.renderObj.wrap = \u003cli\u003e | \u003c/li\u003e\n\nFluid-based solution:\n\n    page.10 = FLUIDTEMPLATE\n    page.10.dataProcessing.10 = B13\\Menus\\DataProcessing\\ListMenu\n    page.10.dataProcessing.10.pages = 13,14,15\n    page.10.dataProcessing.10.as = footerlinks\n    # 0: default, 1 to include nav_hide = 1 pages\n    page.10.dataProcessing.10.includeNotInMenu = 0\n\nUsage in Fluid:\n\n    \u003cnav\u003e\n        \u003cf:for each=\"{footerlinks}\" as=\"page\"\u003e\n            \u003cf:link.page pageUid=\"{page.uid}\"\u003e{page.nav_title}\u003c/f:link.page\u003e\n        \u003c/f:for\u003e\n    \u003c/nav\u003e\n\n\n### Breadcrumb Menu (a.k.a. Rootline Menu)\n\n    page.10 = BREADCRUMBS\n    page.10.excludePages = 4,51\n    # 0: default, 1 to include nav_hide = 1 pages\n    page.10.includeNotInMenu = 0\n    page.10.wrap = \u003cul\u003e | \u003c/ul\u003e\n    page.10.renderObj = TEXT\n    page.10.renderObj.typolink.parameter.data = field:uid\n    page.10.renderObj.wrap = \u003cli\u003e | \u003c/li\u003e\n\n\nFluid-based solution:\n\n    page.10 = FLUIDTEMPLATE\n    page.10.dataProcessing.10 = B13\\Menus\\DataProcessing\\BreadcrumbsMenu\n    page.10.dataProcessing.10.excludePages = 4,51\n    # 0: default, 1 to include nav_hide = 1 pages\n    page.10.dataProcessing.10.includeNotInMenu = 0\n    page.10.dataProcessing.10.as = breadcrumbs\n\nUsage in Fluid:\n\n    \u003cnav\u003e\n        \u003cf:for each=\"{breadcrumbs}\" as=\"page\"\u003e\n            \u003cf:link.page pageUid=\"{page.uid}\"\u003e{page.nav_title}\u003c/f:link.page\u003e\n            \u003cf:if condition=\"{page.isCurrentPage} == false\"\u003e \u0026nbsp; \u003c/f:if\u003e\n        \u003c/f:for\u003e\n    \u003c/nav\u003e\n\n### Dynamic configuration values for the menu (stdWrap)\n\nIf you want to get a menu of the direct siblings of a page, no matter what page you have selected, you can use the stdWrap functions built into each property:\n\n\t9999 = B13\\Menus\\DataProcessing\\TreeMenu\n\t9999 {\n\t\tentryPoints.data = page:pid\n\t\tas = listOfJobPages\n\t}\n\nBy using the `.data` property of the `entryPoints` attribute we can access each property of the currently build page. And so we can render the siblings of the page.\n\n## Technical Details\n\n### Caching\n\nFetching the records is cached in a cache entry (with proper cache tags) within \"cache_hash\",\nand the rendering is also cached in a separated cache entry within \"cache_pages\" for each page (regular),\nwhere active state is applied.\n\n### FAQ\n\nThis extension refrains from handling options `addQueryParams`, or `ADD_GET_PARAM`, or the `target` property\nin order to deal with the pages as \"native\" as possible, like any other link.\n\n## License\n\nThe extension is licensed under GPL v2+, same as the TYPO3 Core. For details see the LICENSE file in this repository.\n\n## Open Issues\n\nIf you find an issue, feel free to create an issue on GitHub or a pull request.\n\n### ToDos\n- add `includeSpacer` option\n- extract stdWrap functionality out of caching parameters\n\n### Credits\n\nThis extension was created by [Benni Mack](https://github.com/bmack) in 2019 for [b13 GmbH](https://b13.com).\n\n[Find more TYPO3 extensions we have developed](https://b13.com/useful-typo3-extensions-from-b13-to-you) that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fmenus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb13%2Fmenus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb13%2Fmenus/lists"}