I want to write a little bit of conditional code which says "If this page is a page generated by Views, do X".

I imagine the "If" as being similar to if ($node->type == 'article'), but for pages instead of nodes. Does something like that exist? Or would there be some completely different method? Have been cruising round Forums & Issues with no success.

Its destination would be a PHP conditional snippets field in Custom Breadcrumbs. Or, I guess, if that didn't work, I might want to do something like it within page.tpl.php. Or failing that I would at least like to understand the principle so I can think of something else :-)

Thanks in advance for any clues!

Comments

dawehner’s picture

Status: Active » Fixed
$view = views_get_page_view();
if (!empty($view)) {
  dsm("this page is a view");
}
Jennifer_M’s picture

Wow super speedy response :-)

Thank you!

Status: Fixed » Closed (fixed)

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