Hi,

Ive seen a lot of queries on this but no solution. Is there a way to execute code in the Title field of each tab? I want to put in icons instead of text.

Thanks.

Comments

beatnbite’s picture

I believe there is no way to execute PHP in tab titles, but you can stop escaping html tags in titles of your tabs as follows:

1. In your module create HOOK_block_view_quicktabs_DELTA_alter(&$data, $block) function, where:
- HOOK - your module name
- DELTA - machine name of your Quicktabs instance

2. In the function iterate over tab titles and set the "html" option for them:

function HOOK_block_view_quicktabs_DELTA_alter(&$data, $block)
{
    foreach ($data['content']['content']['tabs']['tablinks'] as $k=>$v) {
        $data['content']['content']['tabs']['tablinks'][$k]['#options']['html'] = true;
    }
}
theladebug’s picture

I've tried this with a views instance of quicktabs, but it doesn't seem to be working... although I'm not entirely sure where to locate the actual machine name of the block for a views instance of quicktabs.

Any ideas?

Thanks!

theladebug’s picture

I got this to work... I went ahead and modified the quicktabs module to process html in tab titles for any quicktime instance instead of doing this for a specific instance.

I'm still curious if anyone has advice to offer on the above though.

Thanks again,
Teri

Anonymous’s picture

Trying this later on today. Will give feedback. Thanks

smustgrave’s picture

Issue summary: View changes
Status: Active » Closed (outdated)