Download the PHP package youandmedigital/craft-breadcrumb without Composer
On this page you can find all versions of the php package youandmedigital/craft-breadcrumb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download youandmedigital/craft-breadcrumb
More information about youandmedigital/craft-breadcrumb
Files in youandmedigital/craft-breadcrumb
Package craft-breadcrumb
Short Description Generate a simple breadcrumb based on your URL segments
License MIT
Informations about the package craft-breadcrumb
Breadcrumb for Craft CMS
Generate a simple breadcrumb.
Requirements
This plugin requires Craft CMS 5 or later.
Installation
To install the plugin, search for "Breadcrumb" in the Craft Plugin Store, or install manually using composer.
Overview
This plugin will generate a simple breadcrumb array that you can style via Twig. It will generate crumb titles from the customFieldHandle setting if set, falling back to the title field. If none of these fields are present, it will generate the crumb title from the URL segment.
Breadcrumb works across different element types and is multisite friendly. It can even be used to generate BreadcrumbList
schema.
Example
Breadcrumb generates an array like this:
Use Twig to define the presentation and apply additional logic. Use whatever markup that suits your project best. Here's a basic example with no settings applied:
Settings
Breadcrumb has the following settings available:
homeTitle
(string, optional, default 'Home')
Customise the title in the first segment of the breadcrumb.
customBaseUrl
(string, optional, default '@baseUrl')
Set a custom base URL for each crumb in the Breadcrumb array. Use a fully qualified URL without the trailing slash.
customFieldHandle
(string, optional, default 'null')
Specify a custom field handle to generate each crumb title. Requires the setting customFieldHandleEntryId to work.
customFieldHandleEntryId
(int, optional, default '0')
Required for customFieldHandle.
lastSegmentTitle
(string, optional, default 'null')
Customise the last crumb title in the Breadcrumb array. Useful when using custom routing.
skipUrlSegment
(int, optional, default 'null')
Skip a level or segment from the Breadcrumb array. For example, if you had the following URL https://mysite.local/posts/categories/example-category
and you entered 3
as the value, it would remove categories
from the array.
limit
(int, optional, default 'null')
Limit the amount of crumbs returned in the Breadcrumb array.
Example setup with settings applied:
Roadmap
PR & FR welcome!
Brought to you by You & Me Digital