Hi

Love the module and have GMAP working with views. However I really need to theme the Location fields ( and particularly the text saying "If you wish to supply your own latitude and longitude, you may enter them above. If you leave these fields blank, the system will a ............" ) that appear when creating a location enabled node.

The reason it is essential for me is that my content type NEVER has an address, only creator supplied lat/lon. I have managed to hide all fields except Lat and Lon so the text above is going to confuse my contributors.

Ideally it would be nice to also break into the "Location" fieldset with other CCK fields but this is not critical.

Any pointers would be appreciated.

Thanks for your assistance,

Dave

Comments

El Bandito’s picture

OK. Starting line 314 in location.module :

 $element['locpick']['instructions'] = array(
      '#type' => 'markup',
      '#weight' => 1,
      '#prefix' => '<div class=\'description\'>',
      '#value' => '<br /><br />' . t('If you wish to supply your own latitude and longitude, you may enter them above.  If you leave these fields blank, the system will attempt to determine a latitude and longitude for you from the entered address.  To have the system recalculate your location from the address, for example if you change the address, delete the values for these fields.'),

I can obvious edit the module, but I know this would make me a naughty boy. What would be the approved way to change this ?

Cheers

Dave

munikho’s picture

Well, you could just use css no?

imrook’s picture

You can probably go about implementing some kind of form_alter or theme function, but I find theming forms and CCK to be kinda difficult. An easy way to get this done is to use the String Overrides module: http://drupal.org/project/stringoverrides

seanb’s picture

I wanted to replace the field description with my own text. I can't really find out how I'm suppose to do this? I already tried adding a help text to the CCK field and hiding the default description with CSS. The CSS class of the default description text is the same as the classes for the cck help text, so that didn't work.

The way I see it there are a couple of options to configure these texts:

  • Change the classnames so you can hide the default description and show the CCK help text. (quick fix but definitely helpfull!)
  • Add a text field to the module page where you can edit the default text. (a bit better but not the best way)
  • Maybe even remove these texts from the module? Replaced with a more configurable help text container in the CCK configuration page.

Of course one can think of other solutions to the problem! Let me know what you think.

Regards,
Sean

tmcnamara98’s picture

[I had posted about removing the map and lat/long entirely, but I see that this can be done via access control]

yesct’s picture

rooby’s picture

Status: Active » Fixed
Issue tags: +hook_locationapi

form_alter doesn't work for the individual location fields as they are created after that.

You have to use hook_locationapi().

For examples see
#367218: How to force a default on Location Name and disable/protect form input
#443434: Change title of location_cck fields

For documentation of hook_locationapi follow this issue and I hope to have time to document it properly soon. - #480004: Document hook_locationapi()

Status: Fixed » Closed (fixed)
Issue tags: -location theme edit form, -Location theming, -hook_locationapi

Automatically closed -- issue fixed for 2 weeks with no activity.