Finally, I solved it with creating a custom Display Suite field, which can be dragged on the admin interface similar to "regular" fields.
I can suggest this article for quick understanding: http://previousnext.com.au/blog/creating-custom-display-suite-fields-or-how-i-learned-stop-worrying-and-use-hookdsfieldsinfo
To get the necessary data from the field, I used field_get_items()
like this article suggests (this is a must-read!): http://www.computerminds.co.uk/articles/rendering-drupal-7-fields-right-way
This is how I created my custom Display Suite field for getting GPS data from the Get Locations field:
/**
* Implements hook_ds_fields_info().
* @see http://drupalcontrib.org/api/drupal/contributions!ds!ds.api.php/function/hook_ds_fields_info/7
*/
function TESTMODULE_ds_fields_info($entity_type) {
$fields = array();
$fields['node']['MYNODETYPE_gps'] = array(
// title: title of the field
'title' => t('GPS'),
// type: type of field
// - DS_FIELD_TYPE_FUNCTION : calls a custom function.
'field_type' => DS_FIELD_TYPE_FUNCTION,
// ui_limit : only used for the manage display screen so
// you can limit fields to show based on bundles or view modes
// the values are always in the form of $bundle|$view_mode
// You may use * to select all.
// Make sure you use the machine name.
'ui_limit' => array('MYNODETYPE|*'),
// function: only for DS_FIELD_TYPE_FUNCTION.
'function' => 'TESTMODULE_MYNODETYPE_ds_field_gps',
);
if (isset($fields[$entity_type])) {
return array($entity_type => $fields[$entity_type]);
}
return array();
}
/**
* Generate GPS coordinates as a DS field
* Example: 46° 2' 27.24" N 18° 40' 37.2" E
*/
function TESTMODULE_MYNODETYPE_ds_field_gps($field, $title = NULL){
$output = '';
// http://www.computerminds.co.uk/articles/rendering-drupal-7-fields-right-way
// instead of the ugly $on_the_map_getlocations_field_data = $field['entity']->field_MYNODETYPE_on_the_map['und'][0];
$on_the_map_getlocations_field = field_get_items('node', $field['entity'], 'field_MYNODETYPE_on_the_map');
if(isset($on_the_map_getlocations_field[0])){
$on_the_map_getlocations_field_data = $on_the_map_getlocations_field[0];
if(isset($on_the_map_getlocations_field_data['latitude']) && isset($on_the_map_getlocations_field_data['latitude'])){
$output .= theme('getlocations_latitude_dms', $on_the_map_getlocations_field_data);
$output .= ' ';
$output .= theme('getlocations_longitude_dms', $on_the_map_getlocations_field_data);
}
}
return $output;
}
That's all!