gcarr wrote:Hi,
Yes that is pretty much exactly the type of functionality I am looking to create, any help you can give me would be much appreciated or at the least if you can point me in the right direction.
Cheers,
Graham
Well the solution is not elegant as it should be but it works though. I created a separate view for products breadcrumb and a hardcoded breadcrumb for homepage. For that I removed the integrated breadcrumb from the category view. Created 3 master pages : _Root.cshtml( To be used for Homepage) , _RootPages.cshtml(To be used by categories/products page) and
_RootTopicPages (To be used by contact us, login about us pages etc)
In the _Root.cshtml . I just hardcode the breadcrumb in HeaderMenu like:
<div class="nave">
@Html.Action("Menu", "Common")
</div>
<div class="HpBreadcrumb">You are here: <a href="@Url.RouteUrl("HomePage")" >Home </a></div>
And for
_RootPages.cshtml
I added :
<div class="master-wrapper-content">
@Html.Partial("Header")
@Html.Partial("HeaderMenu")
@Html.Partial("Breadcrumb") @Html.Action("WidgetsByZone", "Widget", new { widgetZone = Nop.Core.Domain.Cms.WidgetZone.BeforeContent })
@RenderBody()
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = Nop.Core.Domain.Cms.WidgetZone.AfterContent })
<div class="clear">
</div>
Breadcrumb.cshtml:
@model CategoryModel
@using Nop.Web.Models.Catalog;
@*category breadcrumb*@
@if (Model.DisplayCategoryBreadcrumb)
{
<div class="breadcrumb">
<a href="@Url.RouteUrl("HomePage")">@T("Categories.Breadcrumb.Top")</a> >>
@for (int i = 0; i < Model.CategoryBreadcrumb.Count; i++)
{
var catBr = Model.CategoryBreadcrumb[i];
<a href="@Url.RouteUrl("Category", new { categoryId = catBr.Id, SeName = catBr.SeName })">@catBr.Name</a>
if (i != Model.CategoryBreadcrumb.Count - 1)
{
<text>/</text>
}
}
<br />
</div>
<div class="clear">
</div>
}
I didnt need breadcrumb for topic pages , thats why i didnt modify it .
Hope it makes sense