Override the style generated from display suite field template - Drupal

Sometimes we want to change the style of a field whose style is generated from display suite field template.

In template.php place the following code.

function mytheme_field__expert__title(&$variables) {
// Inspect the contents of $variables.
  krumo($variables);
  if ($variables['element']['#bundle'] == 'flexible_campaign_page') {
    $variables['items'][0]['#markup'] = '<h1 class="gopi">' . $variables['element']['#object']->title . '</h1>';
  }

// Pass back to the display suite theme function for final theming.
  return theme_ds_field_expert($variables);
}

Comments

Popular posts from this blog

Programatically create layout builder section in Drupal

Code quality analysis of Drupal. Can I use Sonar?

Set up Drupal7 to Drupal8 migration in simple steps (using Drush)