thinktomorrow / chief-sitestructure
此包已被 废弃 且不再维护。未建议替代包。
Thinktomorrow/chief cms 的网站结构和面包屑助手
0.2.3
2021-02-02 11:11 UTC
Requires
- thinktomorrow/chief: ^0.5.11
- thinktomorrow/vine: ^0.2.6
Requires (Dev)
- doctrine/dbal: ^2.5
- orchestra/testbench: 4.*
- phpunit/phpunit: ~8.5
- dev-master
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-dependabot/composer/symfony/http-kernel-4.4.50
- dev-dependabot/composer/spatie/browsershot-3.57.4
- dev-dependabot/composer/guzzlehttp/guzzle-7.4.5
- dev-dependabot/composer/guzzlehttp/psr7-1.8.5
- dev-dependabot/composer/league/flysystem-1.1.4
- dev-dependabot/composer/laravel/framework-6.20.26
This package is auto-updated.
Last update: 2024-04-30 00:45:28 UTC
README
Chief sitestructure
此插件为 chief 添加网站结构和面包屑功能。
版本
由于这是一个 Thinktomorrow/chief 的插件,因此需要该包。
此插件还依赖于 chief 中的某些功能,因此仅从 0.4.6 版本开始支持。
安装
composer require thinktomorrow/chief-sitestructure
运行迁移,这将创建 site_structure 表。
php artisan migrate
使用方法
要开始使用页面面包屑,首先将 BreadcrumbAssistant
添加到相关 PageManager。
protected $assistants = [ UrlAssistant::class, ArchiveAssistant::class, PublishAssistant::class, BreadcrumbAssistant::class, ];
助手将为每个页面添加一个字段以选择父页面。
接下来是创建面包屑视图。以下是一个面包屑视图的示例。离线页面将自动从面包屑结构中过滤掉。
@foreach(breadcrumbs($page) as $crumb) @if($loop->last) <svg width="12" height="12" class="mr-2"><use xlink:href="#icon--chevron-right"></use></svg> <span class="text-sm" title="{{ $crumb->label }}" aria-current="page"> {{ $crumb->label }} </span> @else <svg width="12" height="12" class="mr-2"><use xlink:href="#icon--chevron-right"></use></svg> <a href="{{ $crumb->url }}" class="font-medium text-primary-500 hover:underline mr-2 text-sm">{{ $crumb->label }}</a> @endif @endforeach