Incorrect breadcrumbs when PagesNavigationTreeBuilder is not the root node
Closed this issue · 2 comments
If SimpleContent pages are not at the root of the site, as described here https://www.cloudscribe.com/custom-page-routing then child and additional root level pages have incorrect breadcrumbs.
This happens in single and multi-tenant configurations.
To replicate, create a project using these options:
- NoDB
- Single tenant
- Pages and Blog with Home Controller as default route, accepting default names (Articles and /p).
Build and run the site.
Log in, navigate to Articles.
Create new page as prompted, accepting the offered default Heading and Slug "Home". So far we're OK, though it's a bit weird being given default values of Home for this page, but that's not the problem we are reporting here. The breadcrumb is like this:
which is all good. The "Home" link is to the site default page.
Now click on Articles then use "+" to make another page, with Heading "New root page". Now the breadcrumb has become this:
The first Home links to Articles. The second Home links to the site default page. So this is all crazy.
If we change "New root page" to be a true child of "home", the breadcrumb is unchanged.
So let's get rid of the ambiguity about the use of "home". Change the heading and slug of the Articles page from Home and home to Articles and articles. But now when you click on the Articles menu item you get Page not found, so go to Administration > Content Settings and change the Default Page setting to articles instead of home.
Breadcrumbs are now good for the Articles page:
Now create a new page with heading "Another new page" and default settings.
Again, its breadcrumbs are crazy:
Note that if we set this attribute in navigation.xml:
treeBuilderAppendToBuilderNode="false"
like this:
<NavNode key="Pages"
url="/p"
text="Articles"
componentVisibility=""
treeBuilderName="cloudscribe.SimpleContent.Services.PagesNavigationTreeBuilder"
treeBuilderAppendToBuilderNode="false">
<Children />
</NavNode>
then we no longer see the incorrect Articles and Home nodes in the breadcrumbs, but we don't see a Home node either:
This is better, as a workaround, but not how it should be.
candidate fix in cloudscribe.Web.Navigation at v4.1.8