question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Show only the last few breadcrumbs.

See original GitHub issue

🧩 Feature request

To be able to show only the last 4 breadcrumbs. Any preceding breadcrumbs will be displayed as “…” to prevent clutter.

Description

In order to be able to do this, it would be useful to know the index and length of the xngBreadcrumbItem array in HTML.

<xng-breadcrumb> <ng-container *xngBreadcrumbItem="let breadcrumb; let first = first; let last = last; let index = index; let length = length; let count = count;"> <i *ngIf="first" class="fa fa-home"></i> <!--show only 2 dots--> <ng-container *ngIf="!first && index < (count - 4)">..</ng-container> <!--show the last 4 breadcrumbs--> <ng-container *ngIf="!first && index >= (count - 4)">{{ breadcrumb }}</ng-container> </ng-container> </xng-breadcrumb>

Describe the solution you’d like

Just as there is first and last, it would be very useful to have an index and count to be able to perform such functionality in HTML.

Describe alternatives you’ve considered

I considered using the .set. However, at module level the currentBreadcrumb array is still empty and I cannot bind an OnAfterViewInit event to the module. This can be done with an onAfterBreadcrumbsLoaded event.

Another alternative would be a limit parameter to do this more automatically.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dedrazercommented, Nov 26, 2020

I am working on it and will upload a PR soon, thanks.

1reaction
udayvunnamcommented, Nov 26, 2020

@dedrazer Along with exposing length to xngBreadcrumbItem, it will good if it’s a feature from library.

I will work on this. A PR is welcome with the changes too

Read more comments on GitHub >

github_iconTop Results From Across the Web

Filters and breadcrumbs - Product Documentation | ServiceNow
Click a breadcrumb to refresh the list of records and show the latest information for those records. Note: Clicking the New button in...
Read more >
css last child in breadcrumb template - Stack Overflow
Show activity on this post. You can disable the pseudo-elements on only the last li : ... See: http://jsfiddle.net/thirtydot/gDAq4/5/.
Read more >
Breadcrumbs In Web Design: Examples And Best Practices
In this article, we'll explore the use of breadcrumbs on websites and discuss some best practices for applying breadcrumb trails to your own ......
Read more >
Breadcrumbs: 11 Design Guidelines for Desktop and Mobile
Breadcrumbs are a list of links representing the current page and its ... a desktop breadcrumb, where the mobile shows only the last...
Read more >
How to Display BreadCrumb Navigation Links in WordPress
Some of the most popular WordPress themes come with a built-in option to display breadcrumb navigation by choosing Breadcrumb NavXT or your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found