Sites localized versions are setup using Base URL like this:
— http://{baseUrl}/en/
— http://{baseUrl}/fr/
But {baseUrl}
variables are not transformed using craft.app.sites.getAllSites()
.
{% set sites = craft.app.sites.getAllSites() %}
{% for site in sites %}
{{ site.baseUrl }}
// → outputs http://{baseUrl}/locale/ instead of http://mywebsite.com/en/
{% endfor %}
Whereas baseUrl
are set from general.php:
'aliases' => array(
'basePath' => '/mywebsite.com/htdocs/',
'baseUrl' => 'http://www.mywebsite.com/'
),