One thing that is difficult to determine at the page.tpl level is if the $content was generated from a Views or Panels page.

Ken Rickard showed me how you can inspect the menu item returned by menu_get_item() to see if the page is a Views page.

$menu_item = menu_get_item();
if ($menu_item['page_callback'] == 'views_page')) {
  // The current page is a Views page.
}

A little more digging and I realized I could use the same technique to tell if the page is a Panels page.

Awesome! I had been looking for an easy way to know these things, but never found it.

Files: 

Comments

JohnAlbin’s picture

Status: Active » Fixed

Fixed!

Status: Fixed » Closed (fixed)

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

AdrianB’s picture

Just FYI i added these lines in my template.php to detect more Panel pages:

    case 'page_manager_node_view':
    case 'page_manager_contact_site':
JohnAlbin’s picture

Status: Closed (fixed) » Patch (to be ported)

Thanks, Adrian. But you need to re-open the issue if you want me to take action! :-)

JohnAlbin’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev

Ok. I've added those 2 items to Zen 6.x-2.x-dev.

Now I need to port to D7.

JohnAlbin’s picture

Status: Patch (to be ported) » Needs review
FileSize
808 bytes

Needs review!

n8tron’s picture

Status: Needs review » Reviewed & tested by the community

Patch works for me. Nice work!

JohnAlbin’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

AdrianB’s picture

Re #4: Yes, I should have done that but re-open issues is big thing to do that takes some courage... :) Nice to see it being fixed!

Status: Fixed » Closed (fixed)

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