chrisfarber / ember-breadcrumbs

An Ember.js component for adding breadcrumbs to your app.
MIT License
79 stars 34 forks source link

Additional classes per crumb #44

Closed denchen closed 2 years ago

denchen commented 8 years ago

Is it currently possible to define additional CSS classes on a per bread crumb / controller basis? My use case is dynamic segments. I'm displaying those dynamic segments instead of route/controller name, but I want those dynamic segments in a different style (such as bolded or italics) vs. the rest of the crumbs, which are just names of routes. So what I'm looking for is perhaps a breadCrumbClasses variable, or maybe to be able to define a boolean that I can use in the bread-crumbs template to toggle different classes (similar to how isCurrent is used).

The current hack I have is to put the HTML markup directly into the breadCrumb.

eg.

breadCrumb: Ember.computed('model.code', {
    get() {
        return '<b>' + this.get('model.code') + '</b>';
    }
}),

And then modify the bread-crumbs template to use {{{crumb.label}}} instead of {{crumb.label}}. But I don't like that solution much.