The $currentPage variable inside umbraco XSLT macros contains the entire node for the current page, so you can access the properties etc for the current age as well if you need them!
If you want to include the query string as well, you may need to write your own XSLT extension to get it, as the built in umbraco library only gets individual query string items by key IIRC. If you have uComponents installed, that has an extension method already, called ucomponents.request:QueryString().
Get current page URL
I have an XSLT and wonder how i retrieve the URL for the page visited (that is being viewed)?
Example:
I visit
https://www.site.com/library
then the URL i want returned ishttps://www.site.com/library
If i visit
https://www.site.com/library?g="drama"
then the URL would behttps://www.site.com/library?g="drama"
Hi J
Probably everything what you need is
If the XSLT is being rendered as an Umbraco macro, the following should do the trick:
The
$currentPage
variable inside umbraco XSLT macros contains the entire node for the current page, so you can access the properties etc for the current age as well if you need them!If you want to include the query string as well, you may need to write your own XSLT extension to get it, as the built in umbraco library only gets individual query string items by key IIRC. If you have uComponents installed, that has an extension method already, called
ucomponents.request:QueryString()
.is working on a reply...