I'm looking for a way to add the ability for users to toggle one of two view modes. Essentially, looking for a 'list/grid' switch. I've tried using https://www.drupal.org/project/views_modes but it's failing to switch the URL at all.

If anyone has knowledge of a patch/fork of this project, or a way to achieve this, I'd be grateful!

  • 1
    Have you looked at the issues list for that module? Perhaps the patch you are looking for is there? – iain maitland Jul 24 '14 at 15:51
  • I'm actually just going to use a jQuery cookie. I did find a patch, but with its current support, I don't really want to risk it. – Chadsten Jul 24 '14 at 15:55
  • Ok, well be sure to post your code as an answer when you're done :) – iain maitland Jul 24 '14 at 16:03

Display Suite Extras module (part of Display Suite) has an option to do that.

|improve this answer|||||

What about creating two separate views, each set the way you want and a link as Global Text in the header of each that directs to the other.

|improve this answer|||||
  • Interesting. And how would you ajaxify that switch? – Kojo Jul 24 '14 at 20:21
  • 1
    ajax? :) If that's the feel you want, I would create the two views, and use a custom tpl to show them, with some simple jquery to act as a switch, hiding one and showing the other. Both would load at page time but then there's no delay during the switch. – Geoff Jul 24 '14 at 20:36
  • Thanks Geoff. I didn't mention Ajax in the question because I didn't ask it :)) it was just a comment cause I was thinking about a similar feature. .. you might complete your answer – Kojo Jul 24 '14 at 20:41

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.