I guess Panels could make use of the $title_prefix, $title_suffix and $title_attributes template variables, as suggested in http://drupal.org/update/themes/6/7#title-prefix-suffix.

At least I'm currently using this way (the $title_attributes_array) to accomplish the task of inserting an "id" tag to the title of several panels. As suggested in the previous link, also the "contextual links" could benefit of this option.

The following patch (attached in the next post) is an initial approach (I guess) to this. The main modification is done to the panels-pane.tpl.php template file. There is a clash with the hard-coded class="pane-title" inside the template file. I addressed this by moving out the declaration to the template_preprocess_panels_pane() function, using the $vars['title_attributes_array'].

The patch is done against the latest development version of Panels (7.x-3.x-dev).

HTH

MyXelf

PS: Please feel free to ask for any modifications that should be done in order to accomplish this (if you see the whole feature could go into Panels).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MyXelf’s picture

Status: Active » Needs review
FileSize
963 bytes

Attaching the patch and changing the status...

MyXelf’s picture

Bumping this to see if at least someone thinks this could be implemented or not.

merlinofchaos’s picture

Yes it likely will be. I just haven't had a lot of time for Panels patch review lately. Sorry. :(

MyXelf’s picture

At least that is something, and I really appreciate you take a bit of your busy time to take this request into consideration.

There's nothing to excuse.

MyXelf

pixelmord’s picture

Encountered the same problem, wanting to hide the titles while leaving them in markup for screen-readers
adding class "element-invisible"

The code in the patch works for me, although i did not patch panels, but use the preprocessing function in my theme.

But +1 for implementing this :)

merlinofchaos’s picture

Status: Needs review » Fixed

Fantastic, I am happy to see someone did this!

Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit e645619 on 7.x-3.x, 7.x-3.x-i18n, 8.x-3.x by merlinofchaos:
    Issue #1261384 by MyXelf: Support D7 title_prefix and title_suffix on...