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).
Comment | File | Size | Author |
---|---|---|---|
#1 | panels-1261384-title-vars-in-template-1-d7.patch | 963 bytes | MyXelf |
Comments
Comment #1
MyXelf CreditAttribution: MyXelf commentedAttaching the patch and changing the status...
Comment #2
MyXelf CreditAttribution: MyXelf commentedBumping this to see if at least someone thinks this could be implemented or not.
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedYes it likely will be. I just haven't had a lot of time for Panels patch review lately. Sorry. :(
Comment #4
MyXelf CreditAttribution: MyXelf commentedAt 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
Comment #5
pixelmord CreditAttribution: pixelmord commentedEncountered 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 :)
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedFantastic, I am happy to see someone did this!
Committed and pushed.