zHaytam / SmartBreadcrumbs

A utility library for ASP.NET Core (both MVC and Razor Pages) websites to easily add and customize breadcrumbs.
https://blog.zhaytam.com/2018/06/24/asp-net-core-using-smartbreadcrumbs/
MIT License
161 stars 77 forks source link

Bug: Doesn't seem to support Razor Page areas. #70

Closed ajtatum closed 4 years ago

ajtatum commented 4 years ago

This was exactly what I was looking for; however, I ran into issues as soon as I started to implement the Breadcrumb attribute in on Razor pages in Areas. The format structure is different from your tests, they look like: Areas > Area Name > Pages. So, right now, for example, I have a "Blog" area, and even though I specify the below:

     [Area("Blog")]
     [Breadcrumb("Blog", AreaName = "Blog", FromPage = typeof(WebAppName.Web.Pages.IndexModel))]

I get an error that there's already a key /Index. This is because, I have a root IndexModel for the home page and then an IndexModel for the Blog area.

I briefly looked through your code and I couldn't tell where a change would be required. However, I figured I'd post and let you know as you know your code best.

Thank you, AJ

zHaytam commented 4 years ago

Hello, sorry for the delay!

I'm not 100% sure I understand your problem, but did you check the sample project? Areas there have the same action name I believe.