When you add views to your panels the header or title as defined in the view does not appear in the panel.

Comments

marcoBauli’s picture

Title: Panels with views » Panels with views don't show title

True:

the title only appears if you add a block created with Views, but not if you add a view both in page, block or embedd type.

updated title to remember better what's about.

Tobias Maier’s picture

i just want to tell you that I have the same problem...

kbahey’s picture

I can confirm this problem as well, using the latest 4.7 checkout from today.

I worked around it by having this function in a module:

function mymodule_views_pre_view($view, $items) {
 return '<div class="title">' . $view->block_title . '</div>';
}

However, this affects the views in the sidebar as well, not only the ones in the panel. So had to add a switch on $view->vid and hard code the view IDs.

Ugly ...

Hope this can be properly fixed.

stevenlyons’s picture

Title: Panels with views don't show title » Panels with Views lose the View Title

Just to confirm and clarify. Views saved as Block only will also lose their titles.

merlinofchaos’s picture

What I mean is that under 'Configure' for the View in Panels, there is a dropdown that lets you set 'Page', 'Block' or 'Embedded'. It defaults to Page.

You might try 'Embedded', actually, that may get it to not drupal_set_title.

ultraBoy’s picture

Good fix by kbahey, but I'd like to do have it fixed in panels...

'Embedded', really, removes the title from the front page , but I still need a title for that part of a panel.

ultraBoy’s picture

Sorry, title can be added manually with panels. So this feature isn't really urgent. But still would be nice for consistency.

yched’s picture

ultraboy : actually you can't set a title for an embedded view in panels.
Currently, the only way to have a title for a view is to insert it as a block.
I think at least selecting" block" should use the $view->block_title

joel_guesclin’s picture

I think I have a similar problem. I am using this version of Panels:

// $Id: panels.module,v 1.6 2006/08/27 22:31:08 merlinofchaos Exp $

I am using the format with a top, bottom, and three columns. All these contain content generated by Page Views which are lists (except bottom which I don't use - it is empty). What I find is that the View title of the first view always gets displayed. So, this is the title of the View in the top panel. If I empty the top panel, then the title of the first View in the left column is displayed - and so on.

The only way I can think of to get around this it to put the titles I want in the View header... but I would prefer a fix (of course!!)

Otherwise, what a great module!!

kmv’s picture

@joel_guesclin and yched

I am using 5.x but what ultraBoy said works for me and it should work for you.

To fix this, change your panels view type to Embedded (the "Configure" area in the panel), then add a custom title to the same panel (the "Add Custom" button at the bottom of the page), then move the custom title to above the view in the panel (the up arrow icon)

This gives you title for each panel (column) and the page title reverts to the title you set in the "Page Title".

merlinofchaos’s picture

Status: Active » Fixed

Panels 1.1 will include an option to retain the title on views.

Anonymous’s picture

Status: Fixed » Closed (fixed)
jcisio’s picture

Version: 4.7.x-1.x-dev » 6.x-3.x-dev
Category: bug » support
Status: Closed (fixed) » Active

Sorry, but I'd to reopen this issue for easier reference. I'm using Panels 3 and I don't see that option. How do I keep $title in my views?

Thanks.

esmerel’s picture

Status: Active » Closed (fixed)

This issue is over three years old. The code has been completely and totally rewritten for both panels and views. Open a new issue.

esmerel’s picture

Version: 6.x-3.x-dev » 4.7.x-1.x-dev
Category: support » bug