I'm using PHP to control block visibility in a sidebar.

arg() works like a charm for all my node-type pages (giving access to node ID, etc), but I'm having trouble with pages that are views.

Can block visibility PHP get view ID when a view is being displayed as a page?

I can still use arg() to get the page alias, but I'd really like to use the view ID in case an alias changes.

Comments

gargsuchi’s picture

Try this
$view = views_get_current_view();
When u do a print_r of $view, u get a lot of params which are really useful. id s one of them.

Suchi