How can I change wording? "a place of business, venue, meeting point"

mediafrenzy - March 18, 2008 - 06:59
Project:location (API, module)
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm creating a sports site with drupal gmaps and location as a main feature. How can I change the wording that is placed on the location choice section of the content submission page? I'd rather not modify the location.module code itself.

"e.g. a place of business, venue, meeting point"

#1

mediafrenzy - March 22, 2008 - 23:09

Anyone know how to do this? I'm needing to change it to a sports specific phrase, instead of prompting the user for "a place of business, venue, meeting point" etc...

#2

ixlr8 - March 29, 2008 - 02:19

If I'm understanding you correctly, you want to change the text for "location name" in your form, correct? You'll need to override functoin theme_location_form() and add in some logic to look for $form['location']['location_name'] and change the description.

Mike

#3

Balefire - June 5, 2008 - 14:44

I'm coming from an ASP Classic background (without having touched PHP since v3) and tentatively finding my way into PHP5. I have the Pro Drupal Dev book and working my way through that which is a great help. I'm sure that this is probably not the correct way to do this but this is what I did -

  1. copied the whole theme_location_form function into theme/garland/template.php
  2. renamed it garland_location_form

After several attempts I have:

<?php
if ($field_name == 'name') {
 
$form[$field_name]['#description'] = 'My new description';
}
?>

just above $description = $form[$field_name]['#description'];. It works, but if someone could point out if I'm going about this in the wrong way and the correct way of doing this I would appreciate it. Unfortunately I could not work out how to do "...add in some logic to look for $form['location']['location_name']..." in the reply from ixlr8

 
 

Drupal is a registered trademark of Dries Buytaert.