update
I don't have a 5.2 system to fix a working answer for you, so I will just update you on the concepts available:
The Custom URLs are designed to open a popup window in which you can use Javascript to manipulate the current field value. All information from the Component field is therefore passed along inside the window.menuArguments
parameter (at least that was it on R5.3 and 2009, I think it was the same on 5.2, as of 2011 it has become window.dialogArguments
).
If you want to use server side technology (ASP), you will need to fetch the desired information through Javascript and pass that onwards by using an iframe. So then you will get two pages:
- CustomUrlJsPage.html
- sedes.asp
The CustomUrlJsPage.html
is the one you specify in the Custom URL field and could look something like this:
<html>
<head>
<script type="text/javascript">
var opener = window.menuArguments;
var sedesData = "";
function load() {
if (opener) {
if (opener.fieldValue) {
sedesData = opener.fieldValue[0];
}
}
document.all("sedesFrame").src = "sedes.asp?value=" + sedesData;
}
function setValue() {
var sedesFrameDoc = document.frames("sedesFrame").document;
sedesData = sedesFrameDoc.getElementById("someField").value;
window.returnValue = sedesData;
window.close();
}
</script>
<title>Custom Url Loader</title>
</head>
<body style="margin:0; padding:0; overflow:no" scroll="no" onload="load()">
<iframe id="sedesFrame" scrolling="no" width="100%" height="485" frameborder="0"></iframe><br>
<p align="right" style="margin:0; padding:0;">
<input type="button" onclick="setValue()" value="Set" />
<input type="button" onclick="window.close()" value="Cancel" />
</p>
</body>
</html>
Now in this example I used opener.fieldValue[0]
, which gets the first value of the field you clicked the Custom URL on, for other information (like the Component ID), inspect the opener
object in your browsers developer tools.
To set a value back, you will have to make sure that the sedes.asp
page has a form with the value(s) you need, then you can access those from the CustomUrlJsPage.html
as is demonstrated in the SetValue
function.
An example of this is also demonstrated in the Google Maps community extension on SDL Tridion World.
I posted the answer below in the assumption you were using SDL Tridion 2011, but I see you tagged your question with 5.2 now, so this following part is therefore not valid for you...
Custom URLs are opened in a window which contains dialog arguments, these can be accessed through window.dialogArguments
(in Javascript).
I have created an example Custom URL implementation on SDL Tridion World called the Item Selector. If you take a look at the source code and specifically the PopupFunctions.js
file, you can see how you can access the Publication URI from the item on which the Custom URL was called:
var args = window.dialogArguments;
if (args) {
// get current publication uri
var pubid = args.controller.getItemPublicationUri();
}
If you use the developer tools of your browser you can inspect the controller
object and will find out a lot more useful functions on there.
window.menuArguments
in Javascript in the sedes.asp page. I'll update my answer to contain more information on how you can pass it along to server side technology.