Panels seems to extract a View's title and uses it outside. However, I am using a template within Views that calls the View title, but when I insert the view into a panel page, that title is removed.

How can I keep panels from doing this, as the views title element is style inside the view and not outside of it.

Comments

jastraat’s picture

When you set your panel page variant to 'no title', you actually unset the default $title variable. This affects both the head title (addressed in https://www.drupal.org/project/panels_custom_title_tag) and the title anywhere it is called directly.

I'm curious what your use case is however since if you use a content pane display (the views display most compatible with panels) the title of the view would not necessarily be the title of the page.

jremydeaton’s picture

This does answers my question as far as panels are concerned. But making the title adjustments to the panel page still leaves me with my title outside of my view's code.

To answer your question, I was using a Block View as a section of a panel page. So I wanted that section's title (h2) to remain within the view or <section> tag so to speak, as it is set up in the views-view--block-example.tpl.php.

I want this:

<section class="my-view">
    <h2>My View Title</h2>
    <div>My View Content (foreach row)</div>
</section>

But Panels does this to the view:

<h2>My View title is now outside of my actual view code</h2>
<section class="my-view">
    <div>My View Content (foreach row)</div>
</section>

I've tried using a "Content Pane" ( I am assuming this is what you mean by "pane display" ), and It has the same effect.

The only way to fix this in a quick and dirty way is to add the title in a header for the view

jastraat’s picture

Have you tried using a content pane + a template file for panels_pane.tpl.php ?

I would also suggest checking what pane style you are using. You might be able to get what you want by choosing system block for the pane style.