Forum OpenACS Development: Getting a Return Path

Collapse
Posted by Steve Manning on
Hi

I'm looking to put a 'return' link into a couple of pages which can be called from several locations.

Is there a handy proc which will help me out here or do I have to pass the return path in the request?

TIA

    Steve

Collapse
2: Re: Getting a Return Path (response to 1)
Posted by Don Baccus on
When you "call" the page it will be the target of a new HTTP request.  grep around for uses of "return_url" to see how this situation is normally handled.

set return_url [ad_conn url]?[ad_conn query]

will get you a url that references the current page.  Pass it using export_vars if you're generating a hypertext link or in the -export clause to ad_form if you're building a form that needs to include the return address.

Collapse
3: Re: Getting a Return Path (response to 2)
Posted by Steve Manning on
Thanks Don

Setting return_url is what I'd come up with. Hadn't thought of grepping the the source for it but doing so seems to confirm this.

Nice to know I wasn't missing anything.

Ta.

    Steve

Collapse
4: Re: Getting a Return Path (response to 1)
Posted by Jun Yamog on
Hi Don,

Doesn't your ad_return_url already handle this?  Something like:

on .tcl

set current_url [ad_return_url -urlencode]

on .adp

<a href="next_page?return_url=@current_url@">

Although ad_return_url does make use of ns_conn rather than ad_conn which may differ in result in host node map on [ns_conn url] and possibly some other situations too.