It's put in the nav bar which makes the breadcrumbs visible on every site. However I do not want to display it on the home page. So my question is: Is there a way to hide the partial view on the homepage but being able to display it on the rest of the pages?
The first IF is working fine as it hides the breadcrumb on my homepage. The second IF isn't working as it doesn't change the breadcrumb from "Website > 1st page > 2nd page" to "Home > 1st page > 2nd page"
Hiding partial view on specific pages
Hello,
I am currently using a partial view to create breadcrumbs, the partial views looks like this:
I am displaying the partial view on my master page using the following code:
It's put in the nav bar which makes the breadcrumbs visible on every site. However I do not want to display it on the home page. So my question is: Is there a way to hide the partial view on the homepage but being able to display it on the rest of the pages?
Hi Mike
Please, change code of the view to this one:
Replace, please, "homePage" with your home page document type alias.
Thanks,
Alex
Thank you! That did the job. Is there any way I can change the first node though? It currently looks like this:
Website > 1st page > 2nd page etc
This is because the main level is called "Website"
Is there a possibility to change this to "Home" without changing the node name from "Website" to "Home"?
Yes, of course, just like that:
That sadly doesn't work!
The Alias of that page is literally "Website" so I have the following code:
However it stays as "website" on the page and not as "home"
Hi Mike
You have
@if (!Umbraco.AssignedContentItem.DocumentTypeAlias.Equals("Home"))
and
if (Umbraco.AssignedContentItem.DocumentTypeAlias.Equals("Website"))
in this code, so the error is in the first IF also, can it be?
Thanks,
Alex
I don't understand what you mean, sorry.
The first IF is working fine as it hides the breadcrumb on my homepage. The second IF isn't working as it doesn't change the breadcrumb from "Website > 1st page > 2nd page" to "Home > 1st page > 2nd page"
Then your doctype alias is "Home", not "Website"
and you have to use this statement:
if (Umbraco.AssignedContentItem.DocumentTypeAlias.Equals("Home")) { Home } else { @level.Name }
It works, thanks!
is working on a reply...