tabuna / breadcrumbs

Laravel Breadcrumbs - An easy way to add breadcrumbs to your @Laravel app.
https://github.com/tabuna/breadcrumbs
MIT License
338 stars 20 forks source link

Breadcrumbs are not displaying inline #22

Open getlashified opened 3 years ago

getlashified commented 3 years ago

Good Day, Please excuse me if I am wrong, I am still a junior developer. I would like to make note of an issue that I have found and provide a fix.

Implementing what is provided, the outcome is having each <li> on a new line:

@if(Breadcrumbs::has())
    @foreach (Breadcrumbs::current() as $crumbs)
        @if ($crumbs->url() && !$loop->last)
            <li class="breadcrumb-item">
                <a href="{{ $crumbs->url() }}">
                    {{ $crumbs->title() }}
                </a>
            </li>
        @else
            <li class="breadcrumb-item active">
                {{ $crumbs->title() }}
            </li>
        @endif
    @endforeach
@endif

View of display:

Screenshot_2020-11-19 Edit Book Gouws Freeway · Electronic Library Assistant

In order to display the breadcrumbs inline I have to add the <ol> tag back from "tabuna/breadcrumbs": "^1.0" and this seems to be working:

        @if(Breadcrumbs::has())
          <ol class="breadcrumb border-0 m-0">
            @foreach (Breadcrumbs::current() as $crumbs)
              @if ($crumbs->url() && !$loop->last)
                <li class="breadcrumb-item">
                  <a href="{{ $crumbs->url() }}">
                    {{ $crumbs->title() }}
                  </a>
                </li>
              @else
                <li class="breadcrumb-item active">
                  {{ $crumbs->title() }}
                </li>
              @endif
            @endforeach
          </ol>
        @endif

View of working display: Screenshot_2020-11-19 Edit Book Gouws Freeway · Electronic Library Assistant(1)

Thank you.

monkeydev001 commented 2 months ago

Just add display: flex; to .breadcrumb in css