{"id":17148655,"url":"https://github.com/lcharette/uf_breadcrumb","last_synced_at":"2025-04-13T11:42:08.346Z","repository":{"id":55109621,"uuid":"70994902","full_name":"lcharette/UF_Breadcrumb","owner":"lcharette","description":"Breadcrumb service provider for Userfrosting 4","archived":false,"fork":false,"pushed_at":"2021-02-26T22:00:42.000Z","size":68,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T06:37:17.485Z","etag":null,"topics":["userfrosting","userfrosting-sprinkle"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lcharette.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"lcharette","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-10-15T15:07:12.000Z","updated_at":"2021-02-26T22:00:45.000Z","dependencies_parsed_at":"2022-08-14T12:20:13.791Z","dependency_job_id":null,"html_url":"https://github.com/lcharette/UF_Breadcrumb","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcharette%2FUF_Breadcrumb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcharette%2FUF_Breadcrumb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcharette%2FUF_Breadcrumb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcharette%2FUF_Breadcrumb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lcharette","download_url":"https://codeload.github.com/lcharette/UF_Breadcrumb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248709547,"owners_count":21149178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["userfrosting","userfrosting-sprinkle"],"created_at":"2024-10-14T21:29:26.030Z","updated_at":"2025-04-13T11:42:08.323Z","avatar_url":"https://github.com/lcharette.png","language":"PHP","funding_links":["https://ko-fi.com/lcharette","https://ko-fi.com/A7052ICP"],"categories":[],"sub_categories":[],"readme":"# Breadcrumb Sprinkle for [UserFrosting 4](https://www.userfrosting.com)\n\n[![Donate][kofi-badge]][kofi]\n[![Latest Version][releases-badge]][releases]\n[![UserFrosting Version][uf-version]][uf]\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)\n[![Build][build-badge]][build]\n[![Codecov][codecov-badge]][codecov]\n[![StyleCI][styleci-badge]][styleci]\n\n[kofi]: https://ko-fi.com/A7052ICP\n[kofi-badge]: https://img.shields.io/badge/Donate-Buy%20Me%20a%20Coffee-blue.svg\n[releases]: https://github.com/lcharette/UF_Breadcrumb/releases\n[releases-badge]: https://img.shields.io/github/release/lcharette/UF_Breadcrumb.svg\n[uf-version]: https://img.shields.io/badge/UserFrosting-\u003e=%204.3-brightgreen.svg\n[uf]: https://github.com/userfrosting/UserFrosting\n[build]: https://github.com/lcharette/UF_Breadcrumb/actions?query=workflow%3ABuild\n[build-badge]: https://github.com/lcharette/UF_Breadcrumb/workflows/Build/badge.svg?branch=master\n[codecov]: https://codecov.io/gh/lcharette/UF_Breadcrumb\n[codecov-badge]: https://codecov.io/gh/lcharette/UF_Breadcrumb/branch/master/graph/badge.svg\n[styleci]: https://styleci.io/repos/70994902\n[styleci-badge]: https://styleci.io/repos/70994902/shield?branch=master\u0026style=flat\n\nThis Sprinkle provides an helper service and Twig template to manage simple page breadcrumb for [UserFrosting 4](https://www.userfrosting.com).\n\n# Help and Contributing\n\nIf you need help using this sprinkle or found any bug, feels free to open an issue or submit a pull request. You can also find me on the [UserFrosting Chat](https://chat.userfrosting.com/) most of the time for direct support.\n\n# Installation\nEdit UserFrosting `app/sprinkles.json` file and add the following to the `require` list : `\"lcharette/uf_breadcrumb\": \"^3.0.0\"`. Also add `Breadcrumb` to the `base` list. For example:\n\n```json\n{\n    \"require\": {\n        \"lcharette/uf_breadcrumb\": \"^3.0.0\"\n    },\n    \"base\": [\n        \"core\",\n        \"account\",\n        \"admin\",\n        \"Breadcrumb\"\n    ]\n}\n```\n\nRun `composer update` then `php bakery bake` to install the sprinkle.\n\n## Usage\n\n### Adding crumbs\nBreadcrumbs hierarchy needs to be manually defined in each controllers. To dynamically add breadcrumbs to the UI, simply use the `add` method of the `breadcrumb` service:\n\n```php\n// add($name, $uri = \"\")\n$this-\u003eci-\u003ebreadcrumb-\u003eadd('Item name', 'path/');\n```\n\nYou can also chain multiple methods :\n\n```php\n$this-\u003eci-\u003ebreadcrumb-\u003eadd(\"Projects\", \"projects/\")\n                     -\u003eadd(\"Project Foo\", \"projects/foo\")\n                     -\u003eadd(\"Settings\");\n```\n\nThe crumbs can also be created using the `Crumb` object :\n\n```php\n$crumb = new Crumb();\n$crumb-\u003esetTitle('Item name')-\u003esetUri('path/');\n$this-\u003eci-\u003ebreadcrumb-\u003eaddCrumb($crumb);\n```\n\nThe item name can also be switched for a translation key :\n```php\n$this-\u003eci-\u003ebreadcrumb-\u003eadd(['TRANSLATION_KEY', ['placeholder' =\u003e 'Value']], 'path/');\n\n// or\n\n$crumb = new Crumb();\n$crumb-\u003esetTitle('TRANSLATION_KEY', ['placeholder' =\u003e 'Value'])-\u003esetUri('path/');\n```\n\nPath is actually optional if you don't want to provide a link with your crumb. Alternatively, a route name / route pattern placeholders can also be used :\n\n```php\n$this-\u003eci-\u003ebreadcrumb-\u003eadd('Item name', ['route_name', ['id' =\u003e '123']]);\n\n// or\n\n$crumb = new Crumb();\n$crumb-\u003esetTitle('Item name')-\u003esetRoute('route_name', ['id' =\u003e '123']);\n```\n\n### Prepend crumbs\nYou can also use the `prepend` method to add a new item to the beginning of the list:\n\n```php\n//prepend($name, $uri = \"\")\n$this-\u003eci-\u003ebreadcrumb-\u003eprepend(\"Item name\", \"path/\");\n\n// or\n\n$this-\u003eci-\u003ebreadcrumb-\u003eprependCrumb($crumb);\n```\n\nNote that the site index is automatically added to the beginning of the list, whether you use `prepend` or not.\n\n**If you don't add any custom breadcrumbs, it will fallback to the default UserFrosting behaviour.**\n\n## Custom style\n\nThe default UserFrosting layouts and themes will pick up the breadcrumbs automatically. If your UserFrosting theme doesn't include breadcrumbs automatically, simply add this line to your twig files:\n\n```html\n{% include 'navigation/breadcrumb.html.twig' with {page_title: block('page_title')} %}\n```\n\nIf you want to edit the style of the breadcrumbs, simply copy the `templates/navigation/breadcrumb.html.twig` file in your own sprinkle and edit according to your styling. No custom assets are included with this sprinkle.\n\n# Licence\nBy [Louis Charette](https://github.com/lcharette). Copyright (c) 2020, free to use in personal and commercial software as per the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcharette%2Fuf_breadcrumb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flcharette%2Fuf_breadcrumb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcharette%2Fuf_breadcrumb/lists"}