5

We're hoping there's already a module that will do this...

We are creating a page that will contain three view blocks. Each view will have a different exposed filter (all based on taxonomies.) The views are completely independent of one another; they're just going to display on the same page.

What we're looking to do is allow a user to set the filters on each view, and then have Drupal remember those filters. This will be available to authenticated users only, and we're hoping that the filter values can be remembered from session to session.

Example: View 1 will have a Retailer filter, so the user can choose to view all content about Target. View 2 will have a Manufacturer filter, so the user can choose content about General Mills. And so on for as many views as we choose to display on the page.

I know we could do this to a certain extent with javascript and cookies, but as I said, we're hoping it's already been done, as we're under a deadline. Does anyone know of a module that does this? I've tried searching drupal.org for user customization and exposed filters, but the results are overwhelming, and not entirely relevant.

4 Answers 4

10

There is an option in views for this. Go and edit the exposed filter, In the edit form there will be option called

Remember Remember the last setting the user gave this filter.

However I dunno, how to restrict this functionality only to authenticated user.

4
  • The page itself will be restricted to authenticated users, so that isn't an issue. That does what we need, to a certain degree. Do you know how it works? Does it store a cookie, or save something to the database? I tried logging in as user 1 on one browser and setting a filter. If I close the page and go back to it in the same browser, it remembers. If I log in to a different browser as the same user, it doesn't remember.
    – EmmyS
    Commented Sep 21, 2012 at 15:18
  • It will store the value in the session. Commented Sep 21, 2012 at 16:45
  • 1
    @Mathankumar hey i want same facility but i want to store the choices permanently. for this i created a table and set my choices in session. But if user logout once then it doesn't use the session i set, until he apply the expose filter value again. Commented Dec 3, 2012 at 12:23
  • You have the choice to restrict functionality to user, admin or public, per exposed filter, but you need to set them up one by one. Commented Feb 5, 2019 at 2:52
2

i made a simple Module that store User-Pager settings in $_SESSION. It's very easy written just a couple of code lines. So it can be modified to store every user Settings in it. Please check it out:

http://drupal.org/node/1482424#comment-6709534

1

If you take a look to the code of content administration (admin/content/content) you will see that they use the $_SESSION to store the information.

But as Mathankumer say, I think that Views should give it to you.

1

You can use Views Global Filter if you want to remember the filter value permanently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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