Typing this:

[[~[[*id]]? &scheme=`full`]]

Will output:

https://howchoo.com/g/print-the-current-page-url-in-modx

If you break down the expression, you'll see this approach is a combination of:

[[~12345]] => returns the page URL for resource 12345

and:

[[*id]] => normally returns the current page's resource ID

By nesting these, we can return the page URL for the resource ID of the current page.

Comparing performance, syntax, replication, and features.
Gilad Gilad (1)
0