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.

Comments

jhedstrom’s picture

Title: Use title callaback instead of calling drupal_set_title() » Use title callback instead of calling drupal_set_title()
jhedstrom’s picture

Status: Active » Needs review
StatusFileSize
new1.57 KB
jhedstrom’s picture

StatusFileSize
new1.58 KB
morbus iff’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

mgriffith’s picture

Status: Reviewed & tested by the community » Needs work

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

  • jhedstrom committed 265bfb0 on 8.x-1.x
    Issue #2220709 by jhedstrom: Use title callback instead of calling...