Hello, first of I'd like to thank you for creating the module, I've been searching some time for such functionnality compatible with D7.

Even though I had to guess how this module works, I'm pretty sure I correctly attached a mode to a page view type and then displayed the view's mode block (I can see both my available modes appear when I'm on the view's page).

It seems the links are broken though, clicking on them wouldn't change the view's display.

I've tested using

  • Purl 7.x-1.x-dev (both the git provided version and the one displayed on the module's download page)
  • Better exposed filter (I don't think it has anything to do with this issue, but ill mention it anyway)
  • Views (both the 7.x-3.1 and 7.x-3.x-dev versions)
  • Views_Modes 7.x-1.x-dev

Am I doing anything wrong? Is there some crucial step I had to do?

Thank you for helping, and have a great day!

Marc-Antoine

Comments

Marc-Antoine’s picture

Issue summary: View changes

adding some

  • Marc-Antoine’s picture

    Status: Active » Closed (works as designed)

    After searching and testing different config, I finally found out the way to set Purl, using the 'query string' modifier type.

    The module works fine, but would really need some documentation, I could write it down if you wish, I just don't know where to put it

    allio_froggio’s picture

    Would you mind explaining how you made the change to Purl to allow this module to work? I think I'm stuck at the same spot you were...but I don't have your aptitude to figure it out! Thanks!

    Marc-Antoine’s picture

    Status: Closed (works as designed) » Postponed (maintainer needs more info)

    Can you tell me what you've tried so far?

    What you need to do is (in order)

    1. Activate the modules

    2. Create a view

    3. Select your view, then create 3 different display, 1 page and 2 modes (one of the mode should be identical to the page display, since it's the 'default' mode).

    4. Within the Advanced settings of the mode displays, you will find a new section called 'mode settings'.

    4a. Attach your modes to your page's view
    4b. your mode id is a value that'll be displayed within the url, therefore use only lowercase and normal chars (e.g. 'stickers').
    4c. your mode name is the one that'll be displayed in your mode changer block, this can be anything.
    4d. For consistency, change the system names of your view's mode displays for their mode ID (4b), they'll be easier to identify.

    5. If everything's going well, visit admin/config/search/purl.

    5a. You should see 3 tabs (param, modifiers & types).
    5b. Select the third tab first (types) and select the 'query string' option.
    5c. Within the params tab, select the 'Query string' modifier type, and write 'mode' in the 'key' field (this is the word that'll be displayed within your url, in my case it would look like www.site.com/view?mode=stickers).

    6. Now all you need to do is to add the 'Views mode links' block to your view's page (you should see links appearing on your view's page).

    allio_froggio’s picture

    It worked! Thank you so much!

    Of course, nothing is that easy: I set up a test view, just to see if I could get it working on something basic. When I applied it to my calendar view, it gets more complicated when preserving the filters. I'm guessing because the pagination from month to month on the calendar does not actually change the URL. When I change the URL for 12-07 to 12-09 (July to September), the switching preserves the search filters. When I just use the pagers, it does doesn't. Any ideas about that?

    If not, no worries. I'm incredibly grateful that you took the time to write out the above and get me this far! Thanks again!

    Marc-Antoine’s picture

    Interesting implementation.

    Have you tried turning off the 'Use AJAX' option? (under the advanced tab / Other section of your view's edit page)

    That option brakes the views' mode & Purl implementation, since it prevents the exposed filters from changing the url.

    Marc-Antoine’s picture

    allio_froggio’s picture

    Well, that was a duh moment. I turned off Ajax and now it works like a charm!

    Honestly, thank you so so so much!

    Marc-Antoine’s picture

    Title: The view modes' links fail to change the associated view's display mode » View modes needs more documentation!
    Status: Postponed (maintainer needs more info) » Active

    Perhaps it would be in the interest of everyone to put the procedure I wrote on #3 on the module's documentation of something?

    allio_froggio’s picture

    I obviously agree (see above profusion of thanks) and I'm sure that anyone else who is only a front end developer like me would benefit greatly from it!

    batje’s picture

    Status: Active » Closed (fixed)

    Added a README.txt with the comment from #3.

    Thanks!

    batje’s picture

    Issue summary: View changes

    Correcting some grammar and sentence structure stuff (sorry im not that good with english)