I want to add well well-sm to the links list-inline which is defined in the links.var.php. I've tried to redefine the function bootstrap_preprocess_links in my sub theme to add the class and I tried defining it as mybootstrap_preprocess_links (matching the name of my sub theme). But I cannot get anything other than directly editing links.var.php like this to work:

<?php
/**
 * @file
 * links.vars.php
 */

/**
 * Implements hook_preprocess_links().
 */
function bootstrap_preprocess_links(&$variables) {
  if (isset($variables['attributes']) && isset($variables['attributes']['class'])) {
    $string = is_string($variables['attributes']['class']);
    if ($string) {
      $variables['attributes']['class'] = explode(' ', $variables['attributes']['class']);
    }

    if ($key = array_search('inline', $variables['attributes']['class'])) {
      $variables['attributes']['class'][$key] = 'well well-sm list-inline';
    }

    if ($string) {
      $variables['attributes']['class'] = implode(' ', $variables['attributes']['class']);
    }
  }
}

Does anyone know how to do this properly, so I'm not editing the original them?

Comments

markhalliwell’s picture

Status: Active » Closed (won't fix)

Scripted response: This issue has been closed while cleaning up the issue queue. Please read the Drupal Bootstrap Documentation.