{relationship object} $this->rel_names = user_relationships_types_load(); } function option_definition() { $options = parent::option_definition(); $options['name_field'] = array('default' => 'name'); return $options; } function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); $form['name_field'] = array( '#type' => 'radios', '#title' => t('Singular/Plural'), '#default_value' => $this->options['name_field'], '#options' => array('name' => t('Singular name'), 'plural_name' => t('Plural name')), ); } function render($values) { $name = $this->rel_names[parent::render($values)]->{$this->options['name_field']}; //sanity check, return rtid if no name $name = $name ? $name : parent::render($values); return $name; } }