I have page in my website that lists all projects thumbs. When a particular thumb (project) is clicked, Fancybox loads project's details in iframe. All works great! (Content in iframe DOES NOT include navigation, header and other website elements.)
The problem I have is with Google search results page - Google indexed all details pages, and now when user clicks the link from Google results, details content page is opened in browser (instead Fancybox iframe). That is bad since details page does not iclude navigation pages.
Any user friendly solution?
As I mentioned in my comment, you would need to include in each "detail" page a script to sniff the URL and detect if the page was opened in a new window (top page), if so redirect to the main page with a modified URL (using a
hash
for instance) that will allow to open the "detail" page in fancybox from the main page.So you could include in each "detail" page this script:
Change
detailed01
to different value for each "detail" page.Then in the main page you may have links to each detail page like
Notice that I included an
ID
to each anchor that matches thehash
that we will be using while redirecting to the main page.Then your fancybox script can be something like:
I set a DEMO here
This demo open two "detail" pages :
http://www.picssel.com/playground/jquery/detailed01.html and http://www.picssel.com/playground/jquery/detailed02.html
If you try to open them directly, the will redirect to the calling page and open in fancybox
If you're okay with those pages not being indexed by Google then you could add rel="nofollow" to the links:
More details here: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=96569