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

CommentFileSizeAuthor
#6 zen-hardcoded_h2-2448097-6.patch1.03 KBmvdve
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kenorb’s picture

Issue summary: View changes
kenorb’s picture

Title: panels-pane TPL ignores my overrides » panels-pane TPL hardcores H2 tag for every pane label
JohnAlbin’s picture

Status: Active » Closed (won't fix)

H2s 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.

kenorb’s picture

Status: Closed (won't fix) » Active

But 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

ciss’s picture

mvdve’s picture

Version: 7.x-5.5 » 7.x-6.x-dev
Status: Active » Needs review
FileSize
1.03 KB

I created a patch for this issue with a simple fall-back for older versions of panels.

ciss’s picture

Version: 7.x-6.x-dev » 7.x-5.x-dev
maximpodorov’s picture

Great. And what about panels-pane--no-wrapper.tpl.php?

  • JohnAlbin committed b6ea720 on 7.x-5.x authored by mvdve
    Issue #2448097 by mvdve: panels-pane TPL hardcores H2 tag for every pane...

  • JohnAlbin committed 3ef00fe on
    Issue #2448097 by mvdve and JohnAlbin: panels-pane TPL hardcores H2 tag...
JohnAlbin’s picture

Status: Needs review » Fixed

I 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.

  • JohnAlbin committed b6ea720 on 7.x-6.x authored by mvdve
    Issue #2448097 by mvdve: panels-pane TPL hardcores H2 tag for every pane...

  • JohnAlbin committed 3ef00fe on 8.x-7.x
    Issue #2448097 by mvdve and JohnAlbin: panels-pane TPL hardcores H2 tag...
  • JohnAlbin committed b6ea720 on 8.x-7.x authored by mvdve
    Issue #2448097 by mvdve: panels-pane TPL hardcores H2 tag for every pane...

Status: Fixed » Closed (fixed)

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