The source of the issue is theme_quicktabs_tabs function (file quicktabs.module).

All tab title text content goes through check_plain function = all html tags are being encoded in a plain-text string for display as HTML.

To fix we need make 2 changes: add flag into quicktab array and check it on rendering. Views module filters out fields content by itself. So we can do this (file includes/quicktabs.views.inc).

Next we should tell l function not to filter text (file quicktabs.module).

CommentFileSizeAuthor
quicktabs_html_tags_title.patch644 bytesnesta_

Comments

scottm316’s picture

This happened to me in the D7 module (v3.3 and v3.4). I added one line to the quicktabs.module file, safely, because I know it is only trusted users who will be entering values for these fields. I had to because it was escaping double quotes (") into """ and was very unsightly for my use.

On line 592 I added:

$tab['#options']['html'] = TRUE;

Hope that helps someone?

basvredeling’s picture

You can also do this in a theme override function:

function mytheme_qt_quicktabs_tabset($vars) {
  $variables = array(
    'attributes' => array(
      'class' => 'quicktabs-tabs quicktabs-style-' . $vars['tabset']['#options']['style'],
    ),
    'items' => array(),
  );
  foreach (element_children($vars['tabset']['tablinks']) as $key) {
    $item = array();
    if (is_array($vars['tabset']['tablinks'][$key])) {
      $tab = $vars['tabset']['tablinks'][$key];
      
      // added the html option
      $tab['#options']['html'] = TRUE;
      
      if ($key == $vars['tabset']['#options']['active']) {
        $item['class'] = array('active');
      }
      $item['data'] = drupal_render($tab);
      $variables['items'][] = $item;
    }
  }
  return theme('item_list', $variables);
}

thanks for the pointer, scottm316

amitnaik’s picture

It was showing me the anchor tag and its all HTML so i added the line $tab['#options']['html'] = TRUE; in quicktabs.module on 592 just before $item['data'] = drupal_render($tab); and it is now perfect :) thanks scottm316
#1 is working like charm!

ezra-g’s picture

Status: Patch (to be ported) » Closed (duplicate)

This appears to be a duplicate of the feature and patches at #894746: Allow HTML in tab titles.