I created block by "views" by style quicktabs.
The tabs are created correctly but I get the img tags in the actual tab label.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KSiS’s picture

Status: Active » Needs review
FileSize
756 bytes

here's the patch

artem_sylchuk’s picture

I hope it would be better to allow user chose which way titles should be displayed in the style plugin settings.

ultimateboy’s picture

Version: 7.x-3.4 » 7.x-3.x-dev
Status: Needs review » Needs work

I dont mind the idea of exposing filter formats and allowing the user to chose which format to use on tab titles. However, we should dynamically pull in the available text formats and not assume there are only 3: plain/full/filtered.

Berliner-dupe’s picture

Version: 7.x-3.4 » 7.x-3.x-dev

How can i use html-code in normal Tabs-Title? Not over Views!

When i alter the title with hook_quicktabs_alter and i use ...

function mymodule_quicktabs_alter(&$quicktabs) {
$quicktabs->tabs[0]['title'] = 'My Title <span>999</span>';
}

... this not works. After the title i need a counter-result in a span/div-tag. But - its not possible at the moment.

Can anyone help me please?

Regards Matthias

Berliner-dupe’s picture

Version: 7.x-3.x-dev » 7.x-3.4
Berliner-dupe’s picture

Version: 7.x-3.x-dev » 7.x-3.4

Ok - i solved the problem - override theme_qt_quicktabs_tabset and insert there

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

Full code in template.tpl.php

function MY_THEME_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];
      if ($key == $vars['tabset']['#options']['active']) {
        $item['class'] = array('active');
      }
      $tab['#options']['html'] = true; // <--------------------   here inserted
      $item['data'] = drupal_render($tab);
      $variables['items'][] = $item;
    }
  }
  return theme('item_list', $variables);
}

Work perfect now!

kardave’s picture

Status: Needs work » Needs review
FileSize
1.89 KB

Patch from #2 extended with dynamically pulled text formats.

ashutoshsngh’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

https://www.drupal.org/node/2043083#comment-7975771
I applied last patch and selected full html in one of my views.It worked fine.

kardave’s picture

Such achievement :)

tea2sugars’s picture

Random, #7 works great when i'm logged in but when i log out it doesn't work?

Turned on the Default style and it fixed it. Strange!

netw3rker’s picture

Version: 7.x-3.4 » 7.x-3.x-dev
Status: Reviewed & tested by the community » Needs work

I like this idea, can I get someone to re-roll this against 7.x-3.x (it doesn't currently apply)

tormi’s picture

Status: Needs work » Needs review

@netw3rker, it did apply to 7.x-3.8. Changing status for triggering testing once more.