How to provide back link to page? I have created grid view page. When I go click on one specific grid its display content of that grid. Now I want to put one 'back' link in side the page of content, that back link displays main view page.
Though they seem rather simple, "back" links on pages are rather tricky.  For the sake of this post, lets assume that you have a shopping site with a search page, and item detail pages.

One complication arises from the fact that users can arrive on the item detail page from multiple paths, including from Google and other pages that aren't in your site.  The back link really only makes sense when they have come from the search results page.

Another complication comes from how Drupal handles page caching.  You could potentially render a back link on a page, but unless you take some URL parameter into account (to have a different $cid), users may see the wrong cached page.  However, if you do tack on a back= to the URL parameter, you now severely lower the probability that a user will actually get a page from the cache.

I have mostly settled on Javascript based solutions.  There are two main options.  All are real variants on each other.  On the detail page, you jQuery in a link that goes back to the search results.

One way is to jQuery some logic on the search results page that sets a cookie with the exposed filer values, URL, or something similar.  Then on the detail page, you use this to go back.  However, this does not work cross-window / cross-tab, and there are security implications with building links this way.

The second way (and the way I have been using lately) just jQueries in a link on the item detail page that calls window.history.back().  This also isn't ideal, but it tends to be the least bad solution.