Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Im doing a simple facebook share button, but experince something weird
href="https://www.facebook.com/sharer/sharer.php?u=http://www.mydomain.dk/@CurrentPage.Url
returns almost correctly http://www.mydomain.dk//mypage/but with two // between the domain and page url.
href="https://www.facebook.com/sharer/sharer.php?u=http://[email protected]
Hi,
You could try the following. You'll probably want to encode the Url too.
href="https://www.facebook.com/sharer/[email protected](CurrentPage.UrlWithDomain())
Thanks, Dan.
That did the trick, but can someone explain why my razor example doesnt run unless there's a / or a space before the @
xxxxx @Currentpage.Url or xxxx/@Currentpage.Url works, whereas [email protected] doesnt...
how should one write this? i can think of a million other cases where this could be useful.
Hi, Claus,
Try to use NiceNameFullPath.
http://our.umbraco.org/wiki/reference/umbracolibrary/niceurlfullpath
Thanks
I'm not quite sure why it wouldn't work. You could try using string.Format() if you are having issues with your syntax. For example...
var url = string.Format("https://www.facebook.com/sharer/sharer.php?u={0}", HttpUtility.UrlEncode(CurrentPage.UrlWithDomain())) <a href="@url">...</a>
Thanks Alex, but thats xslt
Sorry method is obsolete, but still working
var url = library.NiceUrlWithDomain(nodeId);
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
attaching currentpage url to domain
Im doing a simple facebook share button, but experince something weird
returns almost correctly http://www.mydomain.dk//mypage/
but with two // between the domain and page url.
Hi,
You could try the following. You'll probably want to encode the Url too.
Thanks, Dan.
That did the trick, but can someone explain why my razor example doesnt run unless there's a / or a space before the @
xxxxx @Currentpage.Url or xxxx/@Currentpage.Url works, whereas [email protected] doesnt...
how should one write this? i can think of a million other cases where this could be useful.
Hi, Claus,
Try to use NiceNameFullPath.
http://our.umbraco.org/wiki/reference/umbracolibrary/niceurlfullpath
Thanks
I'm not quite sure why it wouldn't work. You could try using string.Format() if you are having issues with your syntax. For example...
Thanks, Dan.
Thanks Alex, but thats xslt
Sorry method is obsolete, but still working
is working on a reply...