9

Closed

Breadcrumb renders menu when SelectedPath == null

description

Repo:
  1. Create some pages and include them on the main menu.
  2. Add the MenuWidget to the Default layer and check the display as breadcrumb option
  3. Create a new page and do not add it to the navigation menu
  4. View the new page
Outcome - The full menu is shown where the breadcrumb should be.
Expected - Depending on selected options, home page and current page link if selected

The code is in MenuWidgetPartDriver.Display().

if (part.Breadcrumb && selectedPath != null) {
menuItems = selectedPath;
Change to...
if (part.Breadcrumb) {
menuItems = selectedPath ?? Enumerable.Empty<MenuItem>();
Closed Mon at 8:02 PM by sebastienros
Has been fixed by another changeset in the meantime.

comments

edikaufmann wrote Nov 19, 2012 at 3:30 PM

above (quick) fix ....
... solves part of the issue BUT shows on the Breadcrumb now the 'HOME' page which is not the 'correct' page.

jao28 wrote Nov 21, 2012 at 6:13 PM

This is the fix that seems to solve all the issues:

// ADDED BY EMS - start
if (part.Breadcrumb) {
if (selectedPath == null) {
    return null;
}
//if (part.Breadcrumb && selectedPath != null) {
menuItems = selectedPath;
// ADDED BY EMS - end
This gets you into the part.Breadcrumb area but then checks the selected path. If it is null, it returns null. This way no breadcrumb is rendered when there is no selected path.