Developer forum

Forum » Swift » BreadCrumb error

BreadCrumb error

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hi There,

When I add the BreadCrumb Navigation component to a product detail page (in a fresh Swift demo environment, version 1.7.0, DW 9.13.3) I get the following error:

So I think I'm missing some configuration?

Thanks,

Justin

 


Replies

 
Nicolai Pedersen
Nicolai Pedersen
Reply
This post has been marked as an answer

Yeah - one of the pages in your breadcrumb is missing the page item type. And the template should of course not fail in this case.

So you can fix it by adding the item to the page in your breadcrumb that is missing the one - and we will fix the template.

BR Nicolai

Votes for this answer: 1
 
Nicolai Pedersen
Nicolai Pedersen
Reply
This post has been marked as an answer

In the BreadCrumbNavigation.cshtml template change this line:

<ol class="breadcrumb small mb-0 item_@Model.Item.SystemName.ToLower()">

To this - adding the null check after Item property:

<ol class="breadcrumb small mb-0 item_@Model.Item?.SystemName.ToLower()">
Votes for this answer: 1
 
Mike Nicolai Bjerregaard
Mike Nicolai Bjerregaard
Reply

Hi Nicolai,

Am i missing something? any settings?

Since my breadcrumb path doesn't show anything else than "Products"

Taken from swift demo

 

Best Regards

Mike

 
Nicolai Pedersen
Nicolai Pedersen
Reply

It is because the product detail page is hidden in menu - means it will not show up in sitemap. This is a known issue and we are working on a solution in DW to fix that. But you can activate the page in navigation to see the breadcrumb - but it will also show up in your navigation which looks wrong. But we are on it.

 
Melissa Borgmann
Melissa Borgmann
Reply

We're experiencing the same issue; adjusting the BreadCrumbNavigation.cshtml template as directed did not seem to resolve it (see screenshot). Any update on when this will be fixed?

 
Nicolai Pedersen
Nicolai Pedersen
Reply
This post has been marked as an answer

That is because my solution is gibberish :-).

You should just remove this part from the code

item_@Model.Item?.SystemName.ToLower()
Votes for this answer: 1

 

You must be logged in to post in the forum