承接 carbon/navigation 相关项目开发

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

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

carbon/navigation

Composer 安装命令:

composer require carbon/navigation

包简介

Navigation and frontend redirect helper for Neos CMS

README 文档

README

Latest stable version Total downloads License GitHub forks GitHub stars GitHub watchers

Carbon.Navigation Package for Neos CMS

This package provides various helps for implementing navigations in your Neos site.

NodeTypes

All Node Types are marked as abstract. So you have to include them as supertypes if you want to use them. You can read more about Node Type definition here.

Carbon.Navigation:NotInMenu

Hide the property _hiddenInIndex. Defined in NodeTypes.NotInMenu.yaml

Carbon.Navigation:HideSeo

Turn off all type of SEO properties. Defined in NodeTypes.HideSeo.yaml

Carbon.Navigation:RedirectToParentPage

(Only in the live context) Redirect the user to the parent page. Defined in NodeTypes.RedirectToParentPage.yaml and ToParentPage.fusion

Carbon.Navigation:RedirectToFirstChildPage

(Only in the live context) Redirect the user to the first child page, if available. If not, the user gets redirected to the parent page. Defined in NodeTypes.RedirectToFirstChildPage.yaml and ToFirstChildPage.fusion

Carbon.Navigation:References

Insert a property called navigationreferences. It is handy if you want to create a navigation and wants to let the editor to choose which documents should be included. However, you can also pass a custom collection to the Fusion prototype. Defined in NodeTypes.References.yaml and References.fusion

Menu Fusion prototypes

You can edit the default behavior of each fusion prototype in your Settings.yaml. You can set the configuration via Settings.yaml or directly in the corresponding Fusion prototype. The Setting is here to provide an easy way to change some basics without writing Fusion code. If you don't have any entries, no markup at all gets rendered. No more empty <ul> anymore!

Properties for all menu prototypes

Property Description
namespace (string) You can easily change the namespace of the navigation. Useful if you have multiple navigations on your page. Defaults to the name of the prototype
wrapText (boolean || string) If true, the text inside the a gets wrapped with a span. If it is a string, this string will become the tag name. Defaults to false
listTag The tag of the full navigation gets wrapped. If it set to false, the navigation gets no surrounding tag. Defaults to 'ul'
elementTag The tag a navigation entry gets wrapped. If it set to false, the entry gets no surrounding tag. Defaults to 'li'
renderClass (array) The array which defines the css classes for the menu. Read more about this here

The renderClass

The renderClass entry in the setting for each menu type defines the CSS classes for this particular menu. It has three subkeys: list, element and link. Everyone of this key as further entries. If the keys are set to false, this type of class gets not rendered.

Key Description
entryLevel (boolean) Render a class with the entry level
menuLevel (boolean) Render a class with the menu level
subpages (boolean) Render a class who indicate if the node has subpages (shown in the menu) or not
isFirst (boolean) Render a class who indicate the first item in the list
isLast (boolean) Render a class who indicate the last item in the list
state (array) Render classes who indicates which state (normal, active, current or absent) the node has. The values of the states can be false, a string or an array. If it is set to an array, the entry get multiple classes for this particular state
dimension (array) Used only in the dimension menu. You can set if the dimension entry gets also a class with the dimension name (key) and/or the name with the uriPathSegment (value). Very useful if you want to use flags or icons in your dimension menu

Look at Settings.yaml for the default values for the different menu types

Carbon.Navigation:Mixin

Basic Mixin for Menus. Based on Neos.Neos:MenuItems.

Defined in Mixin.fusion

Carbon.Navigation:Menu

Render a menu with items for nodes. Based on Neos.Neos:MenuItems. Besides the default properties following properties are available:

Property Description
maximumLevels (integer) Restrict the maximum depth of items in the menu (relative to entryLevel) . Defaults to 2
filter (string) Filter items by node type, defaults to 'Neos.Neos:Document,!Carbon.Navigation:NotInMenu'
showHome (boolean) If set to true, the homepage link gets rendererd in the menu. Defaults to false
homeLabel (string) Replace the label from site. If set to false, the label from the site itself get used.
entryLevel (integer) Start the menu at the given depth. If no startingPoint is set, it is defaults to 1, otherwise 0
startingPoint (Node) The parent node of the first menu level
lastLevel (integer) Restrict the menu depth by node depth (relative to site node)
renderHiddenInIndex (boolean) Whether nodes with hiddenInIndex should be rendered, defaults to false
itemCollection (array) Explicitly set the Node items for the menu (alternative to startingPoints and levels)

Defined in Menu.fusion

Carbon.Navigation:References

Provides a list of links, based on nodes which are set in the inspector. Based on Carbon.Navigation:Mixin. itemCollection is set to the closest instance of Carbon.Navigation:References who has the property navigationreferences set. maximumLevels defaults to 1 and renderHiddenInIndex defaults to true.

Defined in References.fusion

Carbon.Navigation:Breadcrumb

Provides a breadcrumb navigation based on the current node. Based on Carbon.Navigation:Mixin. listTag defaults to 'ol'.

Property Description
showHome (boolean) If set to true, the homepage link gets rendererd in the menu. Defaults to false
homeLabel (string) Replace the label from site. If set to false, the label from the site itself get used.

Defined in Breadcrumb.fusion

Carbon.Navigation:Dimensions

Create links to other node variants (e.g., variants of the current node in other dimensions) by using this Fusion object. Extends Neos.Neos:DimensionsMenu. If no specific dimension is set, the Neos.Neos:DimensionsMenu prototype output the label from the node, and not the dimensions label. This prototype also fixes this wrong behavior.

Property Description
renderCurrent (boolean) If set to false the current dimension didn't get rendered. Defaults to true
dimension (optional, string) name of the dimension which this menu should be based on. Example: 'language'.
presets (optional, array): If set, the presets rendered will be taken from this list of preset identifiers
includeAllPresets (boolean) If set to true, include all presets, not only allowed combinations. Defaults to false
renderHiddenInIndex (boolean) Whether nodes with hiddenInIndex should be rendered, defaults to true
useUriSegmentAsLabel (boolean) If set to true, the uri segment will get used as label, defaults to false
mulitipleDimensionDivider (string) String to divide multiple dimensions (if no specific dimension is set), defaults to -

Defined in Dimensions.fusion

Carbon.Navigation:Label

A small helper to get the label for an menu entry. Per default, it reads the item.label property. If you want to output just the title you can edit the prototye e. g. like this;

prototype(Carbon.Navigation:Label) {
    renderer = ${q(props.item.node).property('title')}
}

Defined in Label.fusion

carbon/navigation 适用场景与选型建议

carbon/navigation 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 2.59k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 06 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 carbon/navigation 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 2.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • 开发语言: HTML

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2018-06-05