Open pollend opened 4 years ago
Hello,
I'm not sure I understand what the issue (if there is any)?
Would be nice to have some utility methods to build up the list of tags from cshtml.
If I understand correctly, you want something like a Tag
property on breadcrumb nodes so that you do something with it?
So my understanding is the BreadcrumbManager is a graph of nodes for the different page routes. My basic request would be some kind of utility class with enough functionality to generate a custom breadcrumb. There are some other additional functionality such as what I'm currently using it for which is marking out the location in the page navigation.
I guess these are more of my rough thoughts which could improve the library. there isn't anything particularly actionable. Some kind of functionality like this I think would help a lot.
My basic request would be some kind of utility class with enough functionality to generate a custom breadcrumb.
I am very sorry but I still don't get it, especially this part. Can you tell me exactly your use case and how you would like SmartBreadcrumbs to do it? (A sample usage code)
I was thinking of a class like this so the breadcrumb doesn't need to be defined by the library. I'm not sure how useful this would be. I could also use this to mark out the location in the navigation based off the current breadcrumb path. I was thinking about a more front facing class for general usage. I really like the library, just a couple things that I would like to see that are not necessary. if this is not necessary, then I guess this issue can just be closed out.
example, this is kind of one simple usecase but the api can be up for debate.
<div>
@for(var node : @smartbreadcrumb.path(reverse=true)){
{
<a class="{node.defaultName}" href="{node.path}">{node.name}</p>
}
</div>
If the BreadcrumbManager
class made the list of nodes visible, you could do that by injecting it no? (e.g. BreadcrumbManager.Nodes
, and then you foreach them)
you can add a class that is aware of the viewcontext. I'm not sure if a class with IViewContextAware
works with a singleton so it might have to be scope. so you can return a list of nodes for the current route. The functionality is there to generate a breadcrumb for the current path. Something like BreadcrumbManager.Nodes
could work as well or maybe something that describes the current route.
BreadcrumbManager.currentPath <-- the list of nodes for the current path BreadcrumbManager.isOnPath <-- if node is on the current path for the breadcrumb etc ...
so I have these utility methods that I use to tie the navigation bar with the breadcrumb list. should allow for some custom breadcrumbs by iterating over the entries.