Current url to variable problem (should be simple!)
Hi,
I'm sure this should be REALLY easy, but for some reason it just isn't working. I've scoured the forums and can't seem to find an answer to this. Basically all I want to do is pass the current page's url to a variable so I can use it later on.I can get it to print out the site's domain if I take out the following line
but as soon as I try to get the current node, it throws a wobbly and tells me there is a problem with my xslt (System.OverflowException: Value was either too large or too small for an Int32.)
Thanks heaps for your help with my problem, and sorry it's taken me a while to get back about this.
I can see how to store a value into a variable, but not how to send that value to a field (or alias) in another page via Umbraco. I'm no .net/c# wiz so perhaps I'm missing something obvious?
In the end I leveraged on jQuery for the final solution. The user needs javaScript to view videos anyway, so to send the current video to a friend, I copied the url to the iframe form that Doc2Form generates for the user to send off, and it works well.
Cheers
Adam
Code below if you're curious.
$("#email-friend").click(function () {
//Grab the current Page URL
var pageURL = document.location.href;
//Locate the field (#ctl00_ctl00_ContentPlaceHolderDefault_Doc2Form_1_myURL) in the iframe (#email-friend-fr) to store the Page URL
var sendURL = $("#email-friend-fr").contents().find("#ctl00_ctl00_ContentPlaceHolderDefault_Doc2Form_1_myURL");
//Inject the Page URL into the hidden URL field inside the iframe form.
$(sendURL).val(pageURL);
return false;
});
Current url to variable problem (should be simple!)
Hi,
I'm sure this should be REALLY easy, but for some reason it just isn't working. I've scoured the forums and can't seem to find an answer to this. Basically all I want to do is pass the current page's url to a variable so I can use it later on.I can get it to print out the site's domain if I take out the following line
but as soon as I try to get the current node, it throws a wobbly and tells me there is a problem with my xslt (System.OverflowException: Value was either too large or too small for an Int32.)
Below is my code:
Any light that can be shed on this would be much appreciated!
Thanks a lot,
Tom
Sorry this is the code used:
For some reason, the forum won't let me edit the original...
Don't you have to use $currentPage/@id instead of only @id?
Cheers,
/Dirk
Spot on!
Nice one. :D
Hi,
I'd like to take this one step further and insert the value of the url into an alias I've got called "myURL".
I'm working on a "Send to a friend" form using Doc2Form and loading it within an iframe, so I need to feed the form the URL via the myURL alias.
This should be simple, but it's stumping me for now.
Any help is appreciated.
Cheers
Adam
Funnily enough, that's exactly what I wanted it for! :)
Code below:
Good luck!
Tom
Hi Tom,
Thanks heaps for your help with my problem, and sorry it's taken me a while to get back about this.
I can see how to store a value into a variable, but not how to send that value to a field (or alias) in another page via Umbraco. I'm no .net/c# wiz so perhaps I'm missing something obvious?
In the end I leveraged on jQuery for the final solution. The user needs javaScript to view videos anyway, so to send the current video to a friend, I copied the url to the iframe form that Doc2Form generates for the user to send off, and it works well.
Cheers
Adam
Code below if you're curious.
is working on a reply...