承接 webcoast/editable-menus 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webcoast/editable-menus

Composer 安装命令:

composer require webcoast/editable-menus

包简介

Menus editors can change easily in the backend

README 文档

README

TYPO3 CMS extension to create menus independent of the page tree/main menu where editors can change the menu items by selecting the pages, they want in the menu.

Installation

composer req webcoast/editable-menus

Configuration

The extension checks all active packages for a Configuration/Menus.php file. For this extension to correctly determine the extension key, a composer.json file must exist and contain the extra.typo3/cms.extension-key property.

The file must return an array with a valid menu configuration:

<?php

return [
    'the_menu_identifier' => [
        // The menu configuration
    ],
    // ... more menu configurations
];

Attention: It is recommended to use snake case (lowercase with underscore) for the menu identifier to make the conversion work in several places throughout the menu processing.

Minimal configuration

The minimal menu configuration is just an empty array:

<?php

return [
    'header' => [], // This creates a field called `header_menu` in the root page properties
];

Full configuration

<?php

return [
    'header' => [
        'label' => 'My menu label', // Explicitly define a label, can also be a LLL reference
        'description' => 'A description explaining the usage of this menu', // Explicitly define a description, can also be a LLL reference
        'exclude' => false, // Do not make the menu field an exclude field, defaults to true if not defined (null)
        'displayCond' => 'FIELD:is_siteroot:=:1', // Define the display condition of this field. Supports all valid displayCond values. Defaults to `FIELD:is_siteroot:=:1`
        'levels' => 2, // Number of levels for the menu rendering in TypoScript. Defaults to `1`
        'disabled' => true, // Defaults to false, used to disable previously defined menus
    ],
];

Override existing menus

It is possible to override existing menus to change their configuration or disabled them.

To do this, just use the same menu identifier. The configuration is merged using array_replace_recursive.

<?php

return [
    'header' => [
        // Add custom label and description for field `header_menu`
        'label' => 'LLL:EXT:sitepackage/Resources/Private/Language/Menus.xlf:header.label',
        'description' => 'LLL:EXT:sitepackage/Resources/Private/Language/Menus.xlf:header.description',
    ],
    'footer' => [
        // Disable the footer menu, meaning the field is not shown in the backend and the SQL for the database column would not be generated
        'disabled' => true,
    ],
];

Usage

Backend interface

For each configured menu a field is added to the site root properties under the Menu settings tab.

By default, the fields are added as exclude fields, where editors need explicit permission to see it. This can be disabled for each menu individually.

The field name for the menu is generated by appending _menu to the menu identifier:

  • header becomes header_menu
  • footer_lower becomes footer_lower_menu

The label and description are - if not set explicitly - determined automatically by taking by building a LLL references

  • LLL:EXT:{ext-key}/Resources/Private/Language/Menus.xlf:{menu-identifier}.label and
  • LLL:EXT:{ext-key}/Resources/Private/Language/Menus.xlf:{menu-identifier}.description where {ext-key} is the extension key from the extension originally defining the menu, and {menu-identifier} is the menu identifier like header or footer_lower.

Fluid page template - Data processing

TypoScript data processing configuration is automatically added for each configured menu. The variable that holds the menu data in the Fluid template is generated from the identifier by converting the snake_case to UpperCamelCase and prepending menu to it:

  • Identifier header becomes menuHeader in the Fluid template
  • Identifier footer_lower becomes menuFooterLower

The default TypoScript should be sufficient for most use-cases. However, you can override it with your own TypoScript to tweak it, if necessary, e.g. to add sub data processors.

SQL

All necessary SQL to update the database is generated for all configured menus and will be shown/executed with the next database compare/schema update.

webcoast/editable-menus 适用场景与选型建议

webcoast/editable-menus 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 342 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 01 月 31 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「menu」 「cms」 「dynamic」 「typo3」 「menus」 「editors」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 webcoast/editable-menus 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 webcoast/editable-menus 我们能提供哪些服务?
定制开发 / 二次开发

基于 webcoast/editable-menus 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 342
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 16
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2024-01-31