Info
This function is available from ICM 7.10.21.
The function pwaURL()
is used in a template to dynamically generate a URL that is part of a link to the PWA application. The PWA base URL is configured in the property ExternalApplicationBaseURL
.
pwaURL(<urlPath>) pwaURL(<urlPath>, [<pwaQueryParameter>]...)
The following example shows how to generate the link to /products?SKU=foo&category=bar for the PWA in the Backoffice:
<a src="#pwaURL('/products', pwaQueryParameter('SKU', 'foo'), pwaQueryParameter('category', 'bar'))#">To Product</a>
When the template is processed, the generated link replaces the ISML expression like (e.g. with "http://localhost:4200" set as base path):
<a src="http://localhost:4200/products?SKU=foo&category=bar">To Product</a>
Info
To return to the correct locale in the PWA storefront (e.g. the locale of the REST call that was used to trigger an email creation) the pwaURL
function always adds the current locale as matrix parameter to the generated URL.
For this reason the actually generated URL to a German PWA looks like this:
<a src="http://localhost:4200/products;lang=de_DE?SKU=foo&category=bar">To Product</a>
urlPath
The path reference to a specific page in the PWA.
pwaQueryParameter
This optional parameter can be used multiple times. Each pwaQueryParameter
will hold a key and a value to generate HTTP Query Parameters.