There should be default unique classes assigned to the quicktab links. Currently it is not possible to distinguish between the quicktab links, besides using the generated increment ids which are not unique since they depend on the quicktab order.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

psha’s picture

The supplied patch generates quicktab link classes based on the tab type and tab setting keys which represent the tab content uniquely.

psha’s picture

Status: Active » Needs review
pamatt’s picture

Works fine by me, and really useful too. This functionality could be extended to add custom classes to links, and perhaps to the tabpage container.

pamatt’s picture

Status: Needs review » Reviewed & tested by the community
psha’s picture

Thanks for the response. My initial idea was to have this functionality out of the box and always have default classes for tabs. Good remark about the tabpage container, although some types of tabs (like blocks) supply classes/ids in their own container.

netw3rker’s picture

While we wait for a maintainer to come through and review this and others, could I talk you into elaborating on this in the comments:
file: plugins/QuickQuicktabs.inc


    // Encode class suffixes longer than 50 as hash using md5.
    if (strlen($suffix) > 50) {
      $suffix = md5($suffix);
    }
 

It's a little unclear why 50 was decided on since the md5 space is technically smaller. Plus, referencing an md5 hash in css classes/id's will make the css unreadable. If this is to stay, maybe you could add and use a defined constant to indicate the max length, and optionally something that tests whether the developer wants to even convert to md5. Example:

define('QUICKTABS_MAX_SUFFIX', 50);

....
    // convert suffixes greater than QUICKTABS_MAX_SUFFIX to an MD5 hash.
    // if the QUICKTABS_MAX_SUFFIX constant is set to 0 in settings.php, this will be skipped entirely
    if (strlen($suffix) > QUICKTABS_MAX_SUFFIX && QUICKTABS_MAX_SUFFIX) {
      $suffix = md5($suffix);
    }
netw3rker’s picture

Status: Reviewed & tested by the community » Closed (fixed)

I'm going to put this in anyways. This is pretty valuable and needed. We can go through and clean this up later.

Thanks for the contribution!