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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

becw’s picture

Assigned: Unassigned » becw

If 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.

becw’s picture

Assigned: becw » Unassigned
Status: Active » Needs review
FileSize
1.49 KB

Here'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 through hook_media_browser_plugins_alter() as usual (we did discuss changing this so that a drupal_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?

Dave Reid’s picture

Component: Code » Media Browser
Assigned: Unassigned » Dave Reid

Assigning to myself for review.

Dave Reid’s picture

Status: Needs review » Fixed

After 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

Automatically closed -- issue fixed for 2 weeks with no activity.