I'm going to take a guess that your error relates to using page as your variable as I believe it is a reserved name (I had similar issues :) )
This is my breadrumb code
@{
var CurrentPage = UmbracoContext.PublishedRequest.PublishedContent;
}
<ul class="forum-breadcrumb">
@if (CurrentPage.Ancestors().Any())
{
foreach (var bpage in CurrentPage.Ancestors().OrderBy(x => x.Level))
{
if (!bpage.IsDocumentType("forumAuthHolder"))
{
<li class="d-none d-sm-block"><a href="@bpage.Url()">@bpage.Name</a> | </li>
}
}
@* Display the current page as the last item in the list *@
<li class="active d-none d-sm-block">@CurrentPage.Name</li>
}
</ul>
hi thanks man
i'm getting an error now but the code I copied from your comment
doesn't display anything on my page. Hmmmmmmmmmmmm maybe I'm adding it in the wrong place. Can you please walk me through on how you setted it up on your CMS
Breadcrumbs
hi please help me out I'm trying to add bread crumbs on my Umbraco 10 website but i'm getting an error
can some one please help me
@{
what error are you getting?
I'm going to take a guess that your error relates to using page as your variable as I believe it is a reserved name (I had similar issues :) )
This is my breadrumb code
hi thanks man i'm getting an error now but the code I copied from your comment doesn't display anything on my page. Hmmmmmmmmmmmm maybe I'm adding it in the wrong place. Can you please walk me through on how you setted it up on your CMS
if you copied it exactly then it won't work as it has some code specific to my Forum templates, so you need to change this
To this
In my master template I just include it using
sorry for the late reply man thank you so much for the code it worked.
Isn't this built into Unbraco or is there a module available ? When I used to use WP we just used the yoast plugin.
No it isn't built in.
is working on a reply...