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

Breadcrumbs not showing up for subfolder pages in Razor app .NET6 #108

Open
rdkyle opened this issue May 17, 2023 · 1 comment
Open

Breadcrumbs not showing up for subfolder pages in Razor app .NET6 #108

rdkyle opened this issue May 17, 2023 · 1 comment

Comments

@rdkyle
Copy link

rdkyle commented May 17, 2023

I have a folder structure of Pages/Products/Product and the breadcrumbs work fine in the root and Products page but nothing shows in the sub folders of the Products folder for the different products. What else do you need to know from me to help resolve the issue?

Thanks

@techtoniq
Copy link

I had the same problem, with a Pages/Users/User hierarchy, and it was caused because my User page was called Index.cshtml even though it contained a model called UserPageModel.

When the BreadcrumbManager initialises the node hierarchy at startup, it string slices the page type name to generate the node key, so in my case the node hierarchy had a node with a key of "/Users/User". But when the tag manager attempts to generate the breadcrumb when the page is displayed, because the filename of the page is Index.cshtml, it means it is looking for a node with a key of "/Users/Index" and doesn't find it, so only the default breadcrumb is displayed.

The solution in my case was to make sure that the model name in the Razor page matched the file name.

Hope this is helpful for solving you issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants