Closed (won't fix)
Project:
GMap Module
Version:
5.x-1.0-alpha1
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Jun 2008 at 19:39 UTC
Updated:
8 Jan 2013 at 03:16 UTC
All i want to do is change the name of the titles in the location form,
I want to change the name of street and city.... but cannot seem to be able to work out how to do this...
Can you guys please give me a pointer
cheers
please can you reply asap we have a presentation on tuesday :|
this is the only thing that is holding us back ....
Comments
Comment #1
tom_o_t commentedYou'll probably need to create a custom module and use hook_form_alter() to change the titles.
API documentation is at http://api.drupal.org/api/function/hook_form_alter/5 but is not that useful.
See also http://www.drupaldojo.com/minilesson/hook-form-alter-breakdown and http://www.hiveminds.co.uk/node/3109 for more useful tutorials
Comment #2
o0_Enigma_0o commentedHi
thanks for the reply
is there no other way? that hook_form stuff looks a bit over my head :|
cant i just edit the module files?
Comment #3
o0_Enigma_0o commentedJust been thinking...
where do these forms get there information from?
i have checked every file within the mod to see whats going on...
none even have referance to the field names... :|
but i am thinking, are the names stored in the database and if so could i just change the names within the database?
Comment #4
tom_o_t commentedIt's a really bad idea to change the modules as it means you can't update the modules when new releases come out.
The form titles probably come from the location module. I don't think the titles are in the database, though looking at the code in the location module should make that clear.
I'd really recommend just persevering and learning how to use hook_form_alter. Once you understand that you'll be a much better Drupal developer! It will pay off in the long-term...
If you are using the location module you could check out the issue queue in that module, and you may find someone who's dealt with the same issue.
Comment #5
o0_Enigma_0o commentedhi guys...
right i have had ago at this form alter thing and nothing is working..
if i post my code into here could you guys give me some pointers ... pls....
the form object i want to change lands in this code
All i want to change is the word "street" to "building number and street"
my form information
(that is the highest form tag for this form so i think this is the right one)
Ok.
I have been looking at the hook_form_alter stuff and couldnt get my head round it so i went insearch of more info.. and found this http://www.lullabot.com/articles/modifying-forms-5-and-6
i have been following some info on this and tried to put the code in template.php like it says... again nothing seems to happen, but the problem is i am not a php programmer... infact im not really a programmer,
if any of you guys can help it would be fantastic
Many thanks
Comment #6
tom_o_t commentedCreate a new module called location_tweak.module with the necessary .info file to go with it.
In this module:
I'm just guessing about $form_id == 'event_node_form'
To get the correct form id you can un-comment the line beginning print $form_id - this will print all form ids on the page and you can figure out which is the correct one.
Remember that your module should not have the closing ?> tag, but will need the opening one.
Good luck! Remember to follow all the usual guidance for where to put your module - I'm sure you can find that in the handbook if you don't already know.
Comment #7
o0_Enigma_0o commentedhi tom_o_t,
I am gonna try your code out vsoon, just need to read up on the .info file...
Thanks for your help i will let you know how i get one
Comment #8
o0_Enigma_0o commentedthats flipping fantastic ;)
thanks so much for your help
Just made the module and uploaded... i used your first bit of code to find the name of the form first... turned out to be eventgig_node_form, i am going to have to read up on changing more bits now... my location form still needs work..
Thanks again
Comment #9
rooby commentedDrupal 5 is no longer supported.
If this issue affects drupal 6 or 7 please look for an existing issue for that version or else update this issue accordingly.