Forum OpenACS Q&A: Function for current page URL

Collapse
Posted by Tim Adler on
Hi there everyone!

The IT devil, the heat and something evil ate our production and templating system's harddrives.
The support guys weren't able to restore some precious little code I wrote. So again...but I can't remember some bits...

I need a function that returns the actual pages url. Starting form the servername of course. I browsed the API but nothing looked familiar.
I can remember that I had probs with some sites requiring variables. Is there perhaps also a way to get all set parameters as a preformated String?

Thx, for your help!

Collapse
Posted by Tilmann Singer on
ad_return_url will return something like "/path/to/page?x=1&y=2" - hope that is what you need.
Collapse
Posted by Tim Adler on
Thx for the fast answer. But that doesn't seem to work.

invalid command name "ad_return_url"
I guess this is because we are using an older implementation of OpenACS. (The Siemens ShareNet one [and yeah I'm a little bit pi**ed by it ;)])

Any other guess perhaps. I think it was something with ad_page....but I dunno really.

Collapse
Posted by Dirk Gomez on

[ad_conn url] IIRC

You can most certainly also backport ad_return_url by just cut and pasting it from HEAD.

Actually, the ShareNet code is not older than OpenACS, it's just very much forked and based on OpenACS 4.0a. (But - FORKED)

Collapse
Posted by Rocael Hernández Rizzardini on
maybe you are looking for ad_conn
have a look here, at the bottom for more info:
https://openacs.org/doc/openacs-4-6-3/request-processor.html
Collapse
Posted by Dirk Gomez on
Tim, just wanna point out that you should also find a doc subsite that fits your code version on your server at http://servername/doc. Give it a try.
Collapse
Posted by Jun Yamog on
Hi Tim,

In case if its any help.  We where able to successfully backport (cut and paste) ad_return_url to a 4.1.1 site.

Collapse
Posted by Tim Adler on
@jun: Yeah, thx...I'm already STRGing+C+V it ;)!

@rocael: That was my precious little func, thx. I think I'll go and try with the new one.

@dirk: Yeah found that too, but I wasn't able to find any func-description that sounded suitable and/or familiar. I also had logging turned off in my IRClient so couldn't get i from there either)!

Hopefully my copy and pasteing works.

Collapse
Posted by Tim Adler on
Code succesfully stolen ;)!