History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: REDIR-18
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: David Peterson
Reporter: David Dembo
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Confluence Extension: Redirection Plugin

Awareness of redirections

Created: 29/Oct/07 12:18 AM   Updated: 09/Oct/08 03:57 PM
Component/s: {redirect}, {alias}
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
Could some mechanism be implemented such that it is possible to tell the difference between a user arriving at a page via a direct link as and arriving via a {redirect} or {alias} macro? Not sure of the best way to implement this, although preferably it should be done such that the redirecting page object can be manipulated within the page decorators. This would allow things like placing customised messages within the user interface, for example:

"Redirected from Example Page in Example Space. (Edit Redirect)"



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
David Dembo - 07/Mar/08 06:53 AM
I just had a thought that could address this feature request - what if you used cookies? I've got almost no practical experience with cookies - would something like this work?
  • Visiting a page could save the current page's ID to a last-page cookie.
  • Pages with a {redirect} macro could set a last-redirect cookie when the redirect is triggered, with a value of something along the lines of "to=xxxxxx&from=xxxxxx".
  • If the current Confluence page's ID matches the value of 'to', and the value of 'from' matches the 'last-page' cookie's value, you should be able to safely assume that the user arrived there as the result of a redirect.
  • The 'last-page' cookie's value would be overridden after this check, theoretically avoiding problems with accuracy/etc in that 1% of cases , such as following a redirect and then later visiting the same page via a different means.

Of course you wouldn't need to limit the cookie to storing the to & from ID's - it'd be nice if you could specify custom name-value pairs in the {redirect} macro's parameters for example. This would allow some pretty nifty uses, especially if you passed dynamic information using the the replace and render plugin with the {report-info} macro, etc.


Bob Harner - 09/Oct/08 03:57 PM
Cookies have the disadvantage that they are shared among all pages and linked browser tabs and windows, and users can navigate within those windows in an unpredictable order. Also, IE has a limit of 20 cookies per site or domain (you wouldn't want to have a different cookie for each page). So cookies are not a good way to track page-to-page data. Instead, it would probably be better for the redirect macro to add a "redirectfrom" URL argument (like: http://www.example.com/confluence/display/spacename/Some+Page?redirectfrom=Example+Page). Then code in the target page's theme could pull out the redirectfrom argument from the URL and insert the the "Redirected from" message after the title on the page.