Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Breadcrumbs and glyphicons #45

Closed
JeffreyDavidson opened this issue Aug 15, 2014 · 2 comments
Closed

Breadcrumbs and glyphicons #45

JeffreyDavidson opened this issue Aug 15, 2014 · 2 comments

Comments

@JeffreyDavidson
Copy link

I have a template that allows me to have an icon as the text of a link for a list item. Can I do this with this?

I was hoping to do something like this:

Breadcrumbs::register('users', function($breadcrumbs) {
    $breadcrumbs->push('<i class="glyphicon glyphicon-home">');
    $breadcrumbs->push('Users', route('users.index'));
});
@d13r
Copy link
Owner

d13r commented Aug 16, 2014

(I've added the necessary Markdown code to your message to make it readable.)

Yes, but you'll have to make a custom template which doesn't escape the HTML, and you'll therefore have to manually escape any HTML in other titles with e(...).

Also see #34 which is a similar question.

@d13r
Copy link
Owner

d13r commented Oct 29, 2014

In 2.3.0 it's now also possible to add arbitrary data in the third parameter, which you could use to display an icon instead of text:

$breadcrumbs->push('Home', route('home'), ['icon' => 'home']);
@if (!empty($breadcrumb->icon))
    <i class="glyphicon glyphicon-{{{ $breadcrumb->icon }}}"></i>
@else
    {{{ $breadcrumb->title }}}
@endif

@d13r d13r closed this as completed Oct 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants