Allow subclasses to override the menu list

Created on 12 November 2024, 10 days ago

Problem/Motivation

I have a use case where the breadcrumb of a given menu (footer) must be slightly different from what is generated by this module.

<!--break-->

My first thought was to:

  • Extend the MenuBasedBreadcrumbBuilder with higher priority
  • In applies(), restrict the menu list only to footer and call parent method
  • In build(), call the parent method and do my custom stuff

But when extending the MenuBasedBreadcrumbBuilder, it is not possible to alter the menu list.
I have other menus that should use the MenuBasedBreadcrumbBuilder behavior, with higher priority than the footer menu, so changing menu weights is not an option.

Proposed resolution

Move the $this->config->get('menu_breadcrumb_menus') into a dedicated protected function so child classes may override the menu list.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France kbriand

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024