Recently template has been added for Panels called panels-pane.tpl.php.
But I've the problem with it as it's hardcoding <h2>
tags for labels.
The code is:
<h2<?php print $title_attributes; ?>><?php print $title; ?></h2>
And my sample generated html looks like:
<h2 class="pane-title">Description:</h2>
I don't want to use header 2 for just label and it's not pane title, but I don't know from where pane-title is coming.
Initially I didn't know that and I've tried to change it from pane settings in my panel (where I can select h1, h2, h3, div, span), but this option was simply ignored. Then I've tracked the problem with Zen. I know that I can override Zen's template, but I'm trying to fix the problem at its root, instead of doing workaround.
I think the code should be as original, which is:
<<?php print $title_heading; ?><?php print $title_attributes; ?>>
<?php print $title; ?>
</<?php print $title_heading; ?>>
with other updates from the latest Panels module version.
Or simply this template file should be removed from Zen (as the same exists within Panels module), as it doesn't provide any additional functionality, but it's limiting default Panels behaviour.
It was added as part of: #1540948: Catch up with the Panels Everywhere integration and #1931724: Override default panels and panels_everywhere templates
Comment | File | Size | Author |
---|---|---|---|
#6 | zen-hardcoded_h2-2448097-6.patch | 1.03 KB | mvdve |
Comments
Comment #1
kenorb CreditAttribution: kenorb commentedComment #2
kenorb CreditAttribution: kenorb commentedComment #3
JohnAlbinH2s are hard-coded in Panel's tpl file. I just copied over their markup and tweaked it. See http://drupalcontrib.org/api/drupal/contributions!panels!templates!panel...
I'll follow whatever convention Panels uses for its tpl files.
Comment #4
kenorb CreditAttribution: kenorb commentedBut panels doesn't hardcode H2 anymore in their recent version.
See: http://cgit.drupalcode.org/panels/tree/templates/panels-pane.tpl.php
I think code on drupalcontrib.org is a bit outdated, please check the commit from 2015-01-28.
See: #2288747: Panels Title Headings
Comment #5
ciss CreditAttribution: ciss commentedComment #6
mvdve CreditAttribution: mvdve commentedI created a patch for this issue with a simple fall-back for older versions of panels.
Comment #7
ciss CreditAttribution: ciss commentedComment #8
maximpodorov CreditAttribution: maximpodorov commentedGreat. And what about panels-pane--no-wrapper.tpl.php?
Comment #11
JohnAlbinI fixed the panels-pane--no-wrapper.tpl.php.
And we don't need a fallback for old versions of Panels 7.x-3.x. 7.x-3.5 is the latest and the only one we'll support.