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

Dynamic title for breadcrumbs #610

Closed
kevinkasper opened this issue Jun 29, 2023 · 3 comments · Fixed by #614
Closed

Dynamic title for breadcrumbs #610

kevinkasper opened this issue Jun 29, 2023 · 3 comments · Fixed by #614
Assignees
Labels
enhancement New feature or request plugin Covered by an opt-in plugin for Piral.
Milestone

Comments

@kevinkasper
Copy link
Contributor

kevinkasper commented Jun 29, 2023

New Feature Proposal

For more information, see the CONTRIBUTING guide.

Description

I currently have the requirement that the title of the breadcrumbs should be built dynamically using an url with named parameters.

Unfortunately, this is not currently possible, as only static titles are possible:

api.registerBreadcrumb({
    path: '/customers/:customerId',
    title: 'Customer'
});

I would like to define the breadcrumbs as follows:

api.registerBreadcrumb({
    path: '/customers/:customerId',
    title: ({ params }) => <span>Customer - { params.customerId }</span>
});

Is there already such an implementation or a workaround?

Background

A similar behaviour has already been implemented for registering pages and works great:

api.registerPage(
    '/customer/:customerId',
    ({ match }) => <h1>Customer - { match.params.customerId }</h1>
);

Discussion

@kevinkasper kevinkasper added the enhancement New feature or request label Jun 29, 2023
@FlorianRappl
Copy link
Contributor

Yeah we can introduce that - sounds fair. Do you want to make a PR or should we keep it in the backlog?

@FlorianRappl FlorianRappl added this to the 1.1.0 milestone Jun 29, 2023
@FlorianRappl FlorianRappl added the in-review The item is currently being reviewed. label Jun 29, 2023
@kevinkasper
Copy link
Contributor Author

Feel free to add it to your backlog. Unfortunately, I'm not enough of a React expert for this.

Many thanks in advance! 😊

@Flouwrian Flouwrian self-assigned this Jul 7, 2023
@Flouwrian
Copy link
Contributor

I´ll start working on this issue

@FlorianRappl FlorianRappl added in-implementation The item is currently being implemented. plugin Covered by an opt-in plugin for Piral. and removed in-review The item is currently being reviewed. labels Jul 7, 2023
@FlorianRappl FlorianRappl added in-testing The item is already out in preview and can be tested. and removed in-implementation The item is currently being implemented. labels Jul 7, 2023
FlorianRappl added a commit that referenced this issue Jul 10, 2023
@FlorianRappl FlorianRappl removed the in-testing The item is already out in preview and can be tested. label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin Covered by an opt-in plugin for Piral.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants