Problem/Motivation
Sometimes I just want to turn-off Easy Breadcrumb for administration pages.
It can be easier to manage on a site with a different Administration theme and admin pages that don't play well with Easy Breadcrumb.
Proposed resolution
Add a simple configuration checkbox, that is on by default, labeled "Applies to administration pages".
Take the code from the blog post here:
http://www.gregboggs.com/drupal8-breadcrumbs/
$request = \Drupal::request();
$route = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT);
// Do not adjust the breadcrumbs on admin paths.
if ($route && $route->getOption('_admin_route')) {
}
And use it in the method:
\Drupal\easy_breadcrumb\EasyBreadcrumbBuilder::applies()
Remaining tasks
Update the documentation
Write some tests
User interface changes
New configuration option to apply to administration pages - on by default or if never set before
API changes
None.
Data model changes
Update to config schema for new boolean config option.
Comment | File | Size | Author |
---|---|---|---|
#2 | easy_breadcrumb-applies-to-admin-routes-2990803-2.patch | 4.41 KB | chOP |
|
Comments
Comment #2
chOP CreditAttribution: chOP at Deloitte Digital commentedPlease review this patch as starting point. Hope this fits with the direction you're taking the module.
Comment #3
Greg BoggsHey, that's my blog. ;) Code looks good. I'll get it tested and into the next release.
Comment #4
dpacassiThe patch works fine, thanks a lot for the work!
Comment #5
davidbp CreditAttribution: davidbp at 1xINTERNET commentedWork for us too :) using version 8.x-1.8.
Comment #6
ytsurkPlays nicely
Comment #7
renatogGreat! Simple and effective.
+1 to it
P.s. @Greg, your blog is super cool! haha
Congrats :)
Comment #9
renatogCommitted to the dev branch.
Thank you very much for contribution, guys.
Good Work and Good Week!
Best,