Gossamer Forum
Home : Products : Links 2.0 : Customization :

URL from detailed pages, back to link pages...

Quote Reply
URL from detailed pages, back to link pages...
Hi,

I'm trying to find a URL to link from the detaild page back to the main page.

Just say the visitor was in the Category called 'Computers/Internet' and the visitor clicked on a detailed page link, such as 'More Info'. Then s/he was taken to the detailed page. From there, I would like to have a link that says 'Previous Page', which is linked back to the category 'Computers/Internet'.

So I want a link, that linsk back the the category page that the visitor came from.

Can this be done? Thanks!
Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
Well you could just use javascript like so..

<a href="javscript:history.go(-1)>Back</a>

Just add that in your detailed.html template

Hope that helps,
Ian
Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
Or if you do not want to use javascript...add the following link:

Code:
<a href="<%build_root_url%>/<%Category%>"><%Category%></a>

Now...this will only work well if you do not have AltCategories installed.

Regards,



------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
 
Code:
$back = $ENV{'HTTP_REFERER'};

Then define the back tag in the sub site_html_detailed_view in the site_html_templates.pl file:

Code:
back => $back

Then in the detailed.html file, use the following codes:

Code:
<a href="<%back%>">Previous Page</a>

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
Thanks for the replies!

Nofatals:
Your suggestion is good but I would like a url as I already am using the back function you suggested.

AnthroRules:
I've tried your suggestion and it works, but does it work with sub-categories?

An addition to this post, I would liek to add, is it possible to get the link on the detailed page to actually link back to the page that it was on?

Such as a link was on http://www.mysite.com/Computers/more4.html

and someone clicks on a link on that page and is taken to the detailed page for that link. On that page can I have a link that linsk back to http://www.mysite.com/Computers/more4.html?

Maybe the script can work out which page the link is on and then put the right url in the place in the detialed page?

I hope you know what I mean :-). Thanks!


Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
Well, your other solution to make the referring environmental variable to work is use the detail.cgi script, which dynamically creates detailed pages...And it is linked in this forum and in the Resource Center...

Then IT WILL WORK!!!!~!!!!!!!!
!!!!!!!!!!!!!!!!!

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
Thanks for the reply.

I'm not using AltCategories, so it does work, but I just want it to go back to the right page, if it is on page 2 for example.

The following code

$back = $ENV{'HTTP_REFERER'};

would not work anyway, becasue you can only use that if it was cgi generated page, on the fly.

I think I'll have to stay with the first mod that you gave me on the earlier post.

Another problem that I've got is at this forum and really need someone's help on it

http://www.gossamer-threads.com/scripts/forum/resources/Forum3/HTML/004663.html
Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
Is this what you are trying to achieve?

On the page which displays your links, you would like the title to link to the detailed page, then on the detailed page have a the title link back to fore mentioned page?
Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
AnthroRules:

I don't want to use the cgi version of detail.cgi becasue it uses more system resources on the long run.

Nofatals:
yes that is what I want.

so if the link is on 'page2.html' then when the user clicsk through to the detailed page, I need a link back to 'page2.html'.

thanks.
Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
Welp, since you want to use static pages...the solution I provided is the only one.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
Hi Eliot,

How do i get the same result as <a href="javscript:history.go(-3)>Back</a> by using the CGI HTTP_REFERER? Thanks in advnace for the help.


Regards,

Kay



Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
That would be very complicated to do. One suggestion is to looking at the Altavista Spanning Mod and see if you can hack it to provide the back to three pages before function.

Regards,

Eliot Lee
Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
Hi, Elliot. Do you have any other suggestions for creating the back link. I'm NOT using AltCategories. I'm using custom templates. My db_cgi_url is in my main domain. My build_root_url is in one of my subdomains.

When I try both the Javascript option and your $back variable it tries to take me back to a page in my main domain instead of the subdomain.

The <a href="<%build_root_url%></Ętegory%>"><Ętegory%></a> idea won't work either because it takes me back to the main category page instead of the previous page. (For example: If someone gets the detailed view of an item on Computer:Software: page 10 and then clicks on this back button it takes them all the way back to Computer:Software:Page 1.)

Please help!
Thanks
findit1000

Quote Reply
Re: URL from detailed pages, back to link pages... In reply to
Nope...I have no other suggestions at this time.

Good luck finding a solution!

Regards,

Eliot Lee