Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently the tab titles are set from the plugin info hook, which is/can be cached. The titles *should* be set from the view/render step which would allow Views with arguments to override the title.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1292932-2-media-override_media_browser_tab_title.patch | 1.49 KB | becw |
Comments
Comment #1
becw CreditAttribution: becw commentedIf we add a
title()
callback to the new media browser plugin class, we can use that to determine plugin titles. We can provide a default implementation that just returns the plugin's 'title' property from the info hook.Comment #2
becw CreditAttribution: becw commentedHere's a patch that I think addresses this issue. Plugins can set a tab title in the plugin info array or use custom logic in their class's
title()
method. The plugin output is run throughhook_media_browser_plugins_alter()
as usual (we did discuss changing this so that adrupal_alter()
gets called the output of one plugin at a time, but I haven't touched that), and ultimately the#title
property of the plugin output is used as the tab title. Does this give us enough to work with?Comment #3
Dave ReidAssigning to myself for review.
Comment #4
Dave ReidAfter the Media browser cleanup has landed, I committed something like this but implemented in the view() method to allow the title to be changed: http://drupalcode.org/project/media.git/commit/bfa3ac9