We have the need to return to a view with the filters, column header sorts and page intact. I have been able to use a simple $path = $_SERVER['HTTP_REFERER']; statement in a computed field display section on the view page of the node. Works great!

We have set the filters to persist and that gets us close. The column sorts and the page of the view that they are on is not held by those settings.

The issue arises if the user decides to edit the record from the node view form. When he hits save we can use Rules to return to the view but that currently does not contain the settings of the initial view (i.e. filters, sorts and page #). If we had set a new variable such as user->session->ABCview->http_refferer we could use that to build the return Rules.

At this point I have three questions.

Has this been done elsewhere in a module or a code snippet? (perhaps and easier way around)

Is it possible to add variables to the user->session?
(Module Session API - did not see a function there that addressed new variables)
The variables would only need to persist for the length of the session. In this situation we would want to store perhaps 3 different view settings for use by the node view and update forms. As in the example above ABCview->http_refferer, DEFview->http_refferer and GHIview->http_refferer come to mind as an illustration of the concept.

What happens when a user logs in twice?
just looking ahead to ward off any trouble if the above is possible.

Comments

chris pergantis’s picture

Just to let this thread go - we have managed to store the return page and use this to always return to the correct view page, filter and sort for the particular view where the node edit was called from that view or even after an edit that follows the node display (when the user steps thru the node display view and on to the node edit).

Chris Pergantis
Founder/Chairman/President
Accelerated Design Inc