Hi,

I've downloaded version 5.1 of drupal and the HEAD version of the location module. I know there's no drupal5 version of it yet, I just wanted to start playing around with it.

I've started by creating a new content type "route planner", for which I've enabled locative information and have configured it to have 2 locations corresponding to the start and end points of the journey. So now, when I go to create a route planner node, there is a "Locations" group section with "Location #1" and "Location #2" subgroups.

First of all, I don't want a "Locations" group with the individual location subgroups. I want to be able to create my own 2 groups using the "add groups" feature and assign the individual location subgroups to them as appropriate. For example I would create the groups "Start" and "End". In the "Start" group I would like to put the subgroup "Location #1". Likewise "Location #2" would be in the "End" Group. This would allow me to have other fields within my Start and End groups, e.g. time of departure, expected arrival time, etc, and would allow users to have greater flexibility over the placement of the location fields within their node creation form.

Secondly, I would like to be able to rename "Location #1" and "Location #2" subgroups to, for example, "Starting location" and "Destination". I think this would make it clearer for my users to know what to enter where. I can't see any where in the configuration screens to modify the subgroup names.

I hope I've explained this clearly. Let me know if you have any questions.

Cheers,
Stella

Comments

ankur’s picture

The functionality you describe is easily possible, but you will have to find someone that knows PHP/Drupal in order to make it possible.

You'll need to implement a hook_form_alter to change the labels in the form 'Location #'1 and 'Location #2' to be 'start' and 'end' instead.

To see what's involved in adding extra fields to a group of location fields, you can take a look at the example given by
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/location/cont...

This example implements a 'phone number' field to the location form group. Ideally, I'd eventually want to see it validate area-codes and numbers against countries, states, etc, but as it is now, you can easily use it to implement an additional textfield in the location group and change the labels to have the extra field mean something other than location. Unfortunately, this was written only for 4.7 (and I'm not sure when I personally will have a need to update it to 5.x as I only recently implemented said example for a client).

-Ankur

bdragon’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of http://drupal.org/node/47831.

Please followup there.

Thanks.