Skip to content

Url

The Url object represents an external or internal url.

classDiagram
  direction LR
  class Url{
    string absolute
    string relative
  }

It is possible to render the relative url by rendering the object directly.

source
{{ url }}
output
/en/c/foo/22

Properties

Attribute name Type Description
absolute string The absolute url.
relative string The relative url. In the case of an external url, it returns the absolute external url.

Examples

absolute property

{{ url.absolute }}
https://domain.pl/en/c/foo/22

relative property

{{ url.relative }}
/en/c/foo/22

Extensions

The Url object represents only the simplest urls in the storefront. More complex urls are manged by its extensions like:

classDiagram
  direction LR
  MainPageUrl <|-- Url
  CategoryUrl <|-- Url
  CollectionUrl <|-- Url
  ProducerUrl <|-- Url
  ProductsSearchUrl <|-- Url
  ProductsOfTheDayUrl <|-- Url
  NewProductsUrl <|-- Url
  BlogListUrl <|-- Url
  PromotionsUrl <|-- Url
  class Url{
    string absolute
    string relative
  }
  class MainPageUrl{
    array params
    MainPageUrl forPage(int page)
    MainPageUrl forView(string view)
  }
  class CategoryUrl{
    int categoryId
    string categoryName
    CategoryUrl forPage(int page)
    CategoryUrl forView(string view)
    CategoryUrl forSort(int sort)
  }
  class ProducerUrl{
    int producerId
    string producerName
    array params
    ProducerUrl forPage(int page)
    ProducerUrl forView(string view)
    ProducerUrl forSort(int sort)
  }
  class CollectionUrl{
    int collectionId
    string collectionName
    array params
    CollectionUrl forPage(int page)
    CollectionUrl forView(string view)
    CollectionUrl forSort(int sort)
  }
  class NewProductsUrl{
    array params
    NewProductsUrl forPage(int page)
    NewProductsUrl forView(string view)
    NewProductsUrl forSort(int sort)
  }
  class BlogListUrl{
    array params
    BlogListUrl forPage(int page)
  }
  class ProductsOfTheDayUrl{
    array params
    ProductsOfTheDayUrl forPage(int page)
    ProductsOfTheDayUrl forView(string view)
    ProductsOfTheDayUrl forSort(int sort)
  }
  class ProductsSearchUrl{
    array params
    ProductsSearchUrl forPage(int page)
    ProductsSearchUrl forView(string view)
    ProductsSearchUrl forSort(int sort)
  }
  class PromotionsUrl{
    array params
    PromotionsUrl forPage(int page)
    PromotionsUrl forView(string view)
    PromotionsUrl forSort(int sort)
  }
  class LoyaltyProductsListUrl{
    array params
    LoyaltyProductsListUrl forPage(int page)
    LoyaltyProductsListUrl forView(string view)
    LoyaltyProductsListUrl forSort(int sort)
  }