How to know whether panels is used (inside template.php)
public
group: Panels
Rubini - Thu, 2008-06-19 09:58
Hi,
I want to hide the h1.title when panels is used to create an overview of sections. But in normal views there should be the h1.title.
Is there a way to get inside template.php the information if in this page panels is used?
Thank you for helping me.
Michael
Sitewide tags: panels template


Check out the technique used
Check out the technique used on http://drupal.org/node/232644. Basically:
$current_panel = panels_page_get_current();if (!isset($current_panel->pid)) {
// this page is not handled by panels
}
Ugh. That node again. There
Ugh. That node again.
There are several things wrong and/or misleading about the information presented in that node. This is one them.
That method will work fine - IFF you're using panel_pages. While probably the most common way in which panels is used right now, that function is not guaranteed to work in all circumstances. It will be useless if you're using panel nodes, or og_panels, for example, and as more and more modules come out that implement the Panels API on their own, that function will become less and less useful.
At the moment, there's no consistent way to know if Panels is being used from inside a given tpl.php file.