jzubero/silverstripe-sitetree-labels

为您的页面项目添加标签,以便在大型网站树中更好地定位。

安装数: 1,052

依赖项: 0

建议者: 0

安全: 0

星标: 4

关注者: 2

分支: 3

开放问题: 0

类型:silverstripe-module

1.1.2 2021-02-01 00:00 UTC

This package is auto-updated.

Last update: 2024-08-29 04:43:03 UTC


README

Build Status Example SiteTree Label View

使用标签来丰富您的大型和混乱的网站树,添加一些额外的顶级信息。

除了您自定义的标签,该模块还会查找菜单管理器,并自动将菜单集名称分配给页面。

安装

composer require jzubero/silverstripe-sitetree-labels

不要忘记执行dev/build?flush=all

依赖项

  • silverstripe/cms:^3.2
  • ryanpotter/silverstripe-color-field:^0.1.0

功能

  • 设置中的GridField用于添加和链接标签
  • 与菜单管理器模块的集成
  • 报告,用于查找与特定标签链接的页面

配置

您可以通过Config API调整模块的行为。

SiteTree:
  show_labels: true|false
SiteTreeLabel:
  label_color: '#426ef4' # Default label color
  show_menu_labels: true|false # Flag for menu labels generated by HeyDay's Menu Manager Module (if available)

定制

如果您想更改标签的外观,可以将您自定义的样式定义应用于类.sitetree-label。默认样式

.sitetree-label {
    border-radius: 3px;
    font-size: 0.75rem;
    padding: 2px 4px;
    color: #fff;
    text-shadow: none;
}

扩展

您可以通过使用updateSiteTreeLabels钩子方法来通过代码添加额外的标签。

public function updateSiteTreeLabels(ArrayList &$labels) {
    $labels->add([
        'Title': 'My Custom Label',
        'Color': '#ed135a'
    ]);
}

谢谢... 👏

  • ...wmk 为此模块做出了贡献。
  • ...Andreas Spannbauer, Eric HesZauberfisch 在2017年StripeConEU上与我讨论了模块的想法。
  • ...blueskies79 她的错误追踪技能。

维护者