定制 innoweb/silverstripe-breadcrumbs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

innoweb/silverstripe-breadcrumbs

最新稳定版本:3.0.0

Composer 安装命令:

composer require innoweb/silverstripe-breadcrumbs

包简介

Adds configurable and extendable breadcrumbs to the site

README 文档

README

Version License

Overview

Adds configurable and extendable breadcrumbs to the site. Compatible with Symbiote's Multisites and Fromholdio's Configured Multisites fork.

Requirements

SilverStripe CMS 6, see composer.json

Installation

Install the module using composer:

composer require innoweb/silverstripe-breadcrumbs dev-master

Then run dev/build.

Configuration

You can configure whether the home page and pages hidden from the sitetree should be inculded in the breadcrumbs:

Innoweb\Breadcrumbs\Extensions\SiteTreeExtension:
  crumbs_include_home: false # default: true
  crumbs_show_hidden: true # default: false

For a page type you can also disable the crumbs, e.g.:

Your\Project\LandingPage:
  show_crumbs: false # default: true

Usage

By default, the module uses the site tree to generate breadcrumbs.

In your templates, loop over $CrumbList to display the breadcrumbs. You can copy the following code into your template:

<% if $CrumbsList %>
	<nav aria-label="Breadcrumb" class="breadcrumbs">
		<ol itemscope itemtype="https://schema.org/BreadcrumbList">
			<% loop $CrumbsList %>
				<li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
					<% if not $IsFirst %>&gt;<% end_if %>
					<a itemtype="https://schema.org/Thing" itemprop="item" href="$Link"<% if $IsLast %> aria-current="page"<% end_if %>>
						<span itemprop="name">$Title</span>
					</a>
					<meta itemprop="position" content="$Pos" />
				</li>
			<% end_loop %>
		</ol>
	</nav>
<% end_if %>

A page can use the method updateCrumbsList() to add or remove items from the list:

public function updateCrumbsList($list) {
	$tag = $this->getActiveTag();
	if ($tag) {
		$crumb = Crumb::create($tag->Title, $tag->Link());
		$list->push($crumb);
	}
	return $list;
}

License

BSD 3-Clause License, see License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-10-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固