Closed (fixed)
Project:
Gallery
Version:
5.x-2.0-beta3
Component:
User interface / Theming
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Oct 2007 at 03:08 UTC
Updated:
20 Oct 2007 at 16:04 UTC
Since I got recommendation of posting this here, I'll try.
Under user profile view (www.mysite.com/user/1) , I have a field that was added by a module (Gallery).
The title of it, is Gallery2, and inside contains some information about the details of the gallery.
I'm trying to change the title of that section from Gallery2 to "My Gallery"
I've tried two things:
1. A theming on template.php:
function phptemplate_user_profile($account, $fields) {
return str_replace('Gallery2', 'Gallery', theme_user_profile($account, $fields));
}2. A module to change hook_profile_alter
function mytweaks_profile_alter(&$account, &$fields) {
$fields['Gallery2'] = str_replace('Gallery2', 'Gallery', $fields['Gallery2']);
}With both methods, I cannot manage to do this.
Does anyone has an idea of how to do it?
Thanks!
Comments
Comment #1
profix898 commentedUsing str_replace() on array keys wont work AFAIK. Try to use code like this ... (should also work for phptemplate_*)
Comment #2
andydev commentedprofix, that just work beautifully!
I spend a whole evening trying to learn how to do this :)
Comment #3
andydev commentedClosing
Comment #4
Oliver_webmaster commentedOk, but which file did you guys edit to do this? and where in that file do I add it?
Thanks!
Comment #5
profix898 commented@Oliver_webmaster: You either implement this in your own custom module or add it to the template.php file of your theme (see http://drupal.org/node/35728).