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
Hello, I am trying to get the current page URL from Umbraco but I don't want the full folder path, just the current one.
So in my case the URL would be something like this:
https://mysite.com/somepage/some-other-page/my-page-i-want-url-for
In this case you can see I actually only want the part "my-page-i-want-url-for". I tried @Model.Url, but that gives me the fully qualified URL.
Thanks in advance.
Could you do something like this or are you worried about there being other special characters in there? Its not fool proof but it will get the job done if you can control the page names somewhat: @Model.Name.Replace(" ", "-")
-Amir
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to get the current page URL without the full path
Hello, I am trying to get the current page URL from Umbraco but I don't want the full folder path, just the current one.
So in my case the URL would be something like this:
https://mysite.com/somepage/some-other-page/my-page-i-want-url-for
In this case you can see I actually only want the part "my-page-i-want-url-for". I tried @Model.Url, but that gives me the fully qualified URL.
Thanks in advance.
Could you do something like this or are you worried about there being other special characters in there? Its not fool proof but it will get the job done if you can control the page names somewhat: @Model.Name.Replace(" ", "-")
-Amir
is working on a reply...