Bootstrap Accordion Adapting I'm adapting my bootstrap html theme to Drupal 7 and want to use some of the features of Bootstrap 3 theme.

In Bootstrap theme, there is a code for accordion menu like this:

/**
 * Implements theme_bootstrap_bare().
 */
function bootstrap_bootstrap_accordion($variables) {
  $elements = $variables['elements'];

  if (empty($variables['id'])) {
    $accordion_id = 'accordion-' . md5($elements);
  }
  else {
    $accordion_id = check_plain($variables['id']);
  }
  $output = '&lt;div class="accordion" id="' . $accordion_id . '"&gt;';
  foreach ($elements as $id =&gt; $item) {
    $output .= '&lt;div class="accordion-group"&gt;&lt;div class="accordion-heading"&gt;';
    $output .= '&lt;a class="accordion-toggle" data-toggle="collapse" data-parent="#' . $accordion_id . '" href="#' . $id . '"&gt;' . check_plain($item['header']) . '&lt;/a&gt;&lt;/div&gt;';
    $output .= '&lt;div id="' . $id . '" class="accordion-body collapse in"&gt;&lt;div class="accordion-inner"&gt;';
    $output .= render($item['content']);
    $output .= '&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;';
  }
  $output .= '&lt;/div&gt;';
  return $output;
}


My problem is, how can i use this code in my theme for all menus in sidebar region?
Download Views Bootstrap and create a view for the menu you want to display as accordion. For your view format choose Bootstrap Accordion