I'm re-using the code in the achievements_user_page() function in a custom ctools content plugin (posted here if anybody is interested), but since this code calls drupal_set_title(), any panel using this pane will have its title overridden.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | drupal-title-callback-2220709-03.patch | 1.58 KB | jhedstrom |
| #2 | drupal-title-callback-2220709-02.patch | 1.57 KB | jhedstrom |
Comments
Comment #1
jhedstromComment #2
jhedstromComment #3
jhedstrom#2 works on master branch, but fails to apply if #1788800: Account->name should be turned to format_username($account) is also applied. This patch is against #1788800: Account->name should be turned to format_username($account).
Comment #4
morbus iffLooks good to me.
Comment #5
mgriffith commentedI may be missing the point of this patch. If so, please re-mark as reviewed and tested.
Applying the patch in #2 results in the page title for user/%/achievements displaying as just the user name (or the real name replacement, if running that module). The Achievements _tab_ is changed to "Achievements for %username".
Without the patch, the page title is "Achievements for %username" and the tab is 'Achievements'. This original implementation makes more sense to me as we are on a subpage of the user's profile which displays with the username as its full title. I want to differentiate the two pages, so when on the achievements tab, the title Achievements for %username makes more sense.
I agree with removing drupal_set_title() and going with the title callback, but I am not certain why that results in change of the final display.