Skip to content

getUrl()

The getUrl method is used to get the URL of the current page. Object type depends on the context of current page.

Example

For "promotions" context:

source
{% set url = ObjectApi.getUrl() %}
{{ url.relative }}
output
/pl/promotions

For "new products" context:

source
{% set url = ObjectApi.getUrl() %}
{{ url.relative }}
output
/pl/new