I have a views pane included as the main content of a page. I want that the page has this pane title as title (both in <title> and <h1>) but I don't want the pane to repeat it (as <h2>).

While setting the page, I have configured it so it takes the Title Type: from pane and selected the Views pane to provide the Panel title. I wanted to have this so views is in charge of composing the title using arguments: “Books starting with the letter %1” (in my case, it's a glossary).

This is the not-so-good-but-working solution I am using, in template.php:

function mytheme_preprocess_panels_pane(&$vars) {
  if($vars['pane']->type == 'views_panes')
    unset($vars['title']);
}

Can someone think on a better solution? This one is not printing any Views panes titles (I could dive deeper and provide a switch there…).

May question then is: could it make sense an option on the pane – as the one allowing me to set this pane as the Panel title provider – saying “Show title on the pane [ n ] [ y ]”…?

Comments

merlinofchaos’s picture

Status: Active » Fixed

It's not completely obvious, but the system is set up such that if you select 'override title' and set the title to blank on the pane, the pane title will not be printed. However, when inheriting the pane title to the page title, it will use the original title. With a view this is usually what you want. It is not entirely ideal but it will have to do for now. Perhaps in the future we can expand how title inheritance works because the general case is that if you inherit the title of a pane to the page, you don't want the pane to display its title. We could support that better.

tomgf’s picture

Thanks @merlinofchaos. I'll check it out.

Status: Fixed » Closed (fixed)

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

Farreres’s picture

And for drupal 7 how can this be solved? Or is there some standard solution implemented in panels for drupal 7 for this thing?