gibbs / phile-breadcrumbs
Display breadcrumbs in PhileCMS
Installs: 29
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 0
Type:phile-plugin
Requires
This package is not auto-updated.
Last update: 2020-02-21 15:54:21 UTC
README
A PhileCMS plugin that generates breadcrumbs. The plugin returns an array and adds no markup allowing you to use it how you want.
1. Installation
Install via composer
php composer.phar require gibbs/phile-breadcrumbs:1.*
Install via git
Clone this repository from the phile
directory into
plugins/gibbs/phileBreadcrumbs
. E.g:
git clone git@github.com:Gibbs/phileBreadcrumbs.git plugins/gibbs/phileBreadcrumbs
Manual Install
Download and extract the contents into: plugins/gibbs/phileBreadcrumbs
2. Plugin Activation
Activate the plugin in your config.php
file:
$config['plugins']['gibbs\\phileBreadcrumbs'] = array('active' => true);
3. Examples
When the plugin is enabled a breadcrumbs
variable becomes available to
your themes. The breadcrumbs
variable contains the following:
active
(true or false). The last item/crumb is true.meta
. The crumbs parsed meta data. You can use any meta data.uri
. The crumbs relative URL.url
. The crumbs absolute URL.
Minimal Example
{% for crumb in breadcrumbs %} <a href="{{ crumb.url }}">{{ crumb.meta.title }}</a> {% endfor %}
Bootstrap 3 Example
<ol class="breadcrumb"> {% for crumb in breadcrumbs %} {% if crumb.active %} <li class="active">{{ crumb.meta.title }}</li> {% else %} <li><a href="{{ crumb.uri }}">{{ crumb.meta.title }}</a></li> {% endif %} {% endfor %} </ol>
Foundation 5 Example
<ul class="breadcrumbs"> {% for crumb in breadcrumbs %} {% if crumb.active %} <li class="current"><a href="{{ crumb.uri }}">{{ crumb.meta.title }}</a></li> {% else %} <li><a href="{{ crumb.uri }}">{{ crumb.meta.title }}</a></li> {% endif %} {% endfor %} </ul>
Semantic UI Example
<div class="ui breadcrumb"> {% for crumb in breadcrumbs %} {% if crumb.active %} <div class="active section">{{ crumb.meta.title }}</div> {% else %} <a href="{{ crumb.uri }}" class="section">{{ crumb.meta.title }}</a> <span class="divider"> / </span> {% endif %} {% endfor %} </div>