1

I'm just wondering what causes Panels Pages (or cTools pages? Never figured out which is which) to output some panel panes in a <section> html tag wrapper, and output the other panel panes in a <div> html tag wrapper?

I would prefer it if they were one or the other, but not both. So I wanted to understand and find out the reason so I could potentially make it consistent.

Theme I use: AdaptiveTheme (Custom Sub-theme with minimal configurations and changes)

Panels "Variant" Layout: AT One Column (Responsive single column panel layout, AdaptiveTheme core)

enter image description here

  • The "pages" concept comes from the module "Page manager", which is a part of ctools. Panels however is usually used to render them. So you could say both "Panels Pages" or "cTools pages", but they would mean slightly different things. :) – Letharion Jan 21 '14 at 22:44
2

To the best of my knowledge, Panels contains no instances of <section>. This comes entirely from your theme.

Specifically, I believe it's from at_core/templates/panels-pane.tpl.php which contains the following:

 * Adaptivetheme variables:
 * - $is_mobile: Bool, requires the Browscap module to return TRUE for mobile
 *   devices. Use to test for a mobile context.
 * - $tag: top level wrapper element, section or div.

followed by

 <<?php print $tag . $attributes . $id; ?>>

The relevant logic appears to be

/**
 * Preprocess variables for panels_pane.tpl.php
 */
function adaptivetheme_preprocess_panels_pane(&$vars) {
  // Top level wrapper
  $vars['tag'] = $vars['title'] ? 'section' : 'div';
  • So it depends if the pane has a title or not, and that causes it to output either <section> or <div>. Weird logic, doesn't make any sense to me in terms of semantics. Thanks. – Beebee Jan 22 '14 at 9:25
  • It does depend on that yes, but that's just adaptive's logic. Panels itself doesn't care, and you are of course free to override the behavior. – Letharion Jan 22 '14 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.