docs
docs copied to clipboard
canonicalpath not the best way to find lang?
in https://docs.bolt.cm/2.2/howto/building-multilingual-websites#making-templates-and-fetching-content we can find this : {% if app.canonicalpath %} {% set languageslug = app.canonicalpath|split('/')[1] %} {% else %} {% set languageslug = app.paths.current|split('/')[1] %} {% endif %}
but it doesn't work if we host the site in a subfolder, like www.site.com/eventsite_subfolder/nl/index.php, as it will always return languageslug="eventsite_subfolder"
I'd rather use : {% set languageslug = app.request.uri|split(paths.root)[1]|split("/")|first %}
ugly but works better :)