I have a view with two displays as page. I need the URL of the pages as gallery?display=grid and gallery?display=slideshow and filter the views based on the additional parameter 'grid' or 'slideshow'.

Can anyone help me with this?

  • Changing the style plugin (slideshow, map, list, table, etc) based in the display plugin (page, block, etc) is not supported as far as I know. You can always write a new display plugin and make changes to the global $view. I would rather go for views_embed_view call in my own hook_menu page callback. – AyeshK Dec 17 '14 at 23:51

You can load different displays by using the views_get_view_result() function.

$grid_view = views_get_view_result('YOURVIEWNAME', 'grid');
$grid = $grid_view[0];

More documentation is found here and here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.