I have the following category structure:
Top Level
--Team1
-----Team1Products1
-----Team1Products2
-----Team1Products3
--Team2
-----Team2Products1
-----Team2Products2
-----Team2Products3
I have removed the menu as it is not necessary for my simple navigation, and am only using the breadcrumb as a Nav.
I want to exlude the top level menu from the breadcrumb, so that each team stays within it's own subcategory and can't navigate to other team's sites.
I expect that I need to edit the breadcrumb code in the Category template and the Product template (MyDomain/Views/Catalog/CategoryTemplate.ProductsInGridOrLines.cshtml and MyDomain/Views/Catalog/ProductTemplate.Simple.cshtml)
It seems like I should be able to modify the code here to ignore the topmost level menu, and dynamically build the breadcrumb:
<div class="breadcrumb">
Navigation: <a href="~/Team1">Team 1 Home</a>
<ul>
@foreach (var cat in Model.CategoryBreadcrumb)
{
var isLastCategory = cat.Id == Model.Id;
<li>
@if (isLastCategory)
{
<strong class="current-item">@cat.Name</strong>
}
else
{
<a href="@Url.RouteUrl("Category", new {SeName = cat.SeName})" title="@cat.Name">@cat.Name</a>
<span class="delimiter">@breadcrumbDelimiter</span>
}
</li>
}
</ul>
</div>
But it doesn't show anything except the "Navigation: Team 1 Home"
Question 1: How can I improve the code to avoid Hardcoding the "Team 1 Home" in favor of something more dynamic (the name of the highest level Team 1 category would be fine)
Question 2: Why isn't the FOREACH loop working to generate a deeper breadcrumb?
Thanks for any help!