Hi Guys,
I just looked into it further and I did find way to eliminate the outermost span. With the outermost span removed then you could add spans around your additional crumbs and they will be the same as other crumbs.
BreadcrumbsControl breadcrumbs = (BreadcrumbsControl)Master.FindControl("Breadcrumbs");
breadcrumbs.AddedCrumbs = "<span><a class="selectedcrumb" href="/Product-Details.aspx">Product Details</a></span>";
Then you could use the spans for styling if you wanted to.
I think I could possibly eliminate all the spans if I implement a custom SiteMapNodeItem control and use it instead of the default one. But then you would also not be able to use them for styling.
Which solution do you think would be preferable?
-
Just remove the outer span so you can then use spans on your added crumbs and then you could use the spans for styling
-
Eliminate all the spans and just have links inside the out div
Basically the general problem and solution is described in this blog post. Many controls render spans but it is possible to get rid of them if you create a custom control that inherits from the original control, and then you override the Render event and just change it from base.Render(HtmlWriter); to base.RenderContents(htmlWriter); it then leaves out the span that would be the outer markup.
I removed the outmost span by doing this on our mojoSiteMapPath control. To get rid of the rest of them I would need to implement a custom SiteMapNodeItem control.
Best,
Joe