Commit 3889520e authored by Jürgen Haas's avatar Jürgen Haas Committed by Brecht Ceyssens
Browse files

Issue #2426507 by jurgenhaas: Allow link classes for DS fields

parent 9ab5e1cf
Loading
Loading
Loading
Loading
+2 −1
Changes for ds.ds_fields_info.inc: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -79,10 +79,11 @@ function ds_ds_fields_info($entity_type) {
    'properties' => array(
      'settings' => array(
        'link text' => array('type' => 'textfield'),
        'link class' => array('type' => 'textfield', 'description' => t('Put a class on the link. Eg: btn btn-default')),
        'wrapper' => array('type' => 'textfield', 'description' => t('Eg: h1, h2, p')),
        'class' => array('type' => 'textfield', 'description' => t('Put a class on the wrapper. Eg: block-title')),
      ),
      'default' => array('link text' => 'Read more', 'wrapper' => '', 'class' => '', 'link' => 1),
      'default' => array('link text' => 'Read more', 'link class' => '', 'wrapper' => '', 'class' => '', 'link' => 1),
    )
  );

+3
Changes for ds.module: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1031,6 +1031,9 @@ function ds_render_field($field) {
    else {
      $uri_info = entity_uri($field['entity_type'], $field['entity']);
    }
    if (isset($settings['link class'])) {
      $uri_info['options']['attributes']['class'][] = $settings['link class'];
    }
    $output = l($output, $uri_info['path'], $uri_info['options']);
    if ($title_field) {
      $output = ds_edit_support('title', $output, $field);