Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set multiple breadcrumbs regardless of route #163

Closed
AndriesN opened this issue Feb 24, 2023 · 11 comments
Closed

Set multiple breadcrumbs regardless of route #163

AndriesN opened this issue Feb 24, 2023 · 11 comments
Labels
enhancement New feature or request help wanted Extra attention is needed no-issue-activity wontfix This will not be worked on

Comments

@AndriesN
Copy link

🧩 Feature request

Set multiple breadcrumbs regardless of route

Description

I would like to have the ability to add multiple breadcrumbs when I'm on a url.
Example:
route is localhost:4200/path1
then when I resolve data, I use that data to build my own breadcrumb path, I cannot do that as of right now. I can only set one breadcrumb using the .set() method.

Describe the solution you'd like

I'd like a solution where I can inject the breadcrumbService and use an .add() function (maybe?) so I can add multiple breadcrumbs.

Describe alternatives you've considered

I tried using multiple empty route paths with a breadcrumb, also tried ways to access the breadcrumb[] object but could not figure out how I can add multiple breadcrumbs to the array.

@AndriesN AndriesN added the enhancement New feature or request label Feb 24, 2023
@github-actions
Copy link

Hello 👋 @AndriesN
Thank you for raising an issue. We will investigate into the issue and get back to you as soon as possible. Please make sure you have given us as much context as possible.
Feel free to raise a PR if you can fix the issue. Check the local development guide

@gabrielbergoc
Copy link

I want this functionality too

@udayvunnam
Copy link
Owner

@AndriesN @gabrielbergoc Can you confirm the below understanding of the requirement

Instead of

breadcrumbService.set('mentors', 'Mentor View');
breadcrumbService.set('mentor/:id', 'Uday Vunnam');

we want
breadcrumbService.add('mentors', 'Mentor View').add('mentor/:id', 'Uday Vunnam')

to make it easy to define the dynamic breadcrumbs?

@gabrielbergoc
Copy link

That would work for me!
But maybe add the "add" method, not replace "set"? I don't know if it's possible...
Like, the current interface and behavior remain unchanged, but at page "x" I may want to add, besides "x", "y" and "z", so that they remain in the breadcrumbs if I navigate further, and when I navigate backwards, only "x > y > z" are removed.
And maybe another methods like "remove", "has", etc.

@AndriesN
Copy link
Author

AndriesN commented Apr 6, 2023

Yes, that would be great!

@udayvunnam udayvunnam added the help wanted Extra attention is needed label Apr 6, 2023
@stale
Copy link

stale bot commented Aug 11, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 11, 2023
@udayvunnam udayvunnam removed the wontfix This will not be worked on label Aug 12, 2023
@udayvunnam
Copy link
Owner

not stale

@anuj9196
Copy link

I also want this feature.

Basically, the requirement is that some elements exist on a path without a parent component, but logically are part of a parent component.

Example

Home > Quiz > Quiz 1 > Session > Session 1

I want breadcrumb like this, but the actual path to Session 1 is

{
    path: '/quiz/session',
    data: {breadcrumb: {alias: 'quizName'}}
    children: [
        {
            path: ':id',
            component: SessionComponent,
            data: {breadcrumb: {alias: 'sessionName'}}
        }
    ]
}

Now with this path, I can only set the breadcrumb to the :id path and cannot set the Quiz > Quiz 1 in the breadcrumb.

If support to add multiple breadcrumbs is given, it can be something like

this.breadcrumbService.add([['/quiz', 'Quiz'], ['@quizName', this.getQuizName()], ['/quiz/session', 'Session'], ['@sessionName', this.getSessionName()]);

Copy link

stale bot commented Mar 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 13, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@FedeTommi
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed no-issue-activity wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants