Download & Extend

How can i pass a session variable to views filter

Project:Views
Version:5.x-1.6
Component:Views Data
Category:feature request
Priority:minor
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hello Everybody

I want to know how to pass a session variable or cookie to a views filter,
So that views should be automatically select the correct filtering option using session variable.

Thanks in advance

Comments

#1

Priority:normal» critical

I have the same question, because i want to store exposed filters in session. This will give users an opportunity not to enter filter when they navigate to view page next time.

#2

Version:5.x-1.5» 6.x-2.x-dev
Category:support request» feature request
Priority:critical» minor

#3

Version:6.x-2.x-dev» 5.x-1.6
Status:active» fixed

This is something you'd do in the argument handling code section.

You could do something like: $view->filters[3]['value'] = $_SESSION['my_stored_value'];

Note that this will only set the default for the exposed filter if you have the right option checked in the exposed filters.

#4

Thanx to merlinofchaos

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

nobody click here