Currently, Menu Block does not allow users to make the block title a link to the menu item if they have specified block title override text. I'd like to be able to make the block title a link to the menu item, but also be able to override the text of the link.

I'm attaching a patch that provides this new functionality. I welcome any feedback on the approach or implementation. Please note that there is an update hook, so you will need to run update.php after patching.

Some implementation details:
The original block title override field is provided by the Block module, which if specified, will override any title (including HTML for a link) that Menu Block sets. So in order for users to specify override text for the block title and still allow Menu Block to make the title a link, I added a new field to the Menu Block configuration that replaces the Block module's title override field. Then when Menu Block renders the block title, it uses this new field as the block title or block title link text if a value was specified. I also added an Update hook to migrate any existing title override text for menu blocks into the new field.
The majority of the changes are related to how the data is stored - the only difference an end user would see is that they are now able to set the block title to link to the menu item and also override the text.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jlapp’s picture

Status: Active » Needs review
FileSize
6.8 KB
abuzakaria’s picture

The patch in #1 is working fine.

mr.york’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Works for me. Thank you.

Dave Reid’s picture

I'm not sure this is worth adding since this sounds like very custom functionality. I would recommend adding a custom hook_block_view_alter() to a site's custom module instead for this behavior.

Dave Reid’s picture

Status: Reviewed & tested by the community » Closed (won't fix)