Problem/Motivation
Navigation block is auto-loaded meaning it is difficult to change or replace with another block.
Proposed resolution
Add hooks and options to swap out block or modify common bits of existing block.
Remaining tasks
Provide patch
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
Added more flexibility to customise the navigation block.
Credit
Initial code from `fathimaasmat`
Comments
Comment #3
scott_euser commentedAttached patch
Comment #4
fathima.asmat commentedThe current "chapter_heading_label_alter" function does not take the chapter headings into account instead it alters the chapter SECTION headings, so it would be good to reword the function to "chapter_section_heading_label_alter".
Also adding a couple more hooks to alter the chapter headings in similar way and another hook to customise chapter menu item markup would be useful.
The patch and interdiff files are provided for these edits/additions.
Comment #6
scott_euser commentedOkay I think I've got what you are trying to achieve. I've refactored a bit to make the alter of the menu item broader to allow the full render array to be modified.
You should now be able to do this:
I've also added the `chapter_label` and `chapter_heading` alters to alter the two labels. I've kept `chapter_heading` as the headings within the chapter as that matches the object name and database storage for it.
Comment #8
scott_euser commented