Access current URL

Get the full path of the current page you are on from within a template.

You can use the absolute_url variable in your template to get the full URL to the page you are currently on.

Example: https://www.mydomain.com/locations/seattle/subpage/

Example of usage

Current page URL: {{ absolute_url }}
<a href="/some-page/?previous_page={{ absolute_url|urlencode }}">
  Some Page
<a>

Last updated