Closed jimblue closed 2 years ago
Any update about this?
Just busy with other things. If you can find a fix, propose a Pull Request and i'll take a look. Cheers.
@rhukster sure I will 😄 !
Hey @jimblue I'm having the same issue with a website right now did you find a fix?
Has anyone found a solution?
@elemention I ended up creating a quick fix in the plugin's template directly:
I added theses lines at line 10 of the langswitcher.html.twig
file
{% if langswitcher.page_route == '/' %}
{% set lang_url = base_lang_url %}
{% else %}
{% set lang_url = base_lang_url ~ langswitcher.page_route ~ page.urlExtension %}
{% endif %}
nope @gen035 didn't find a fix
@elemention I ended up creating a quick fix in the plugin's template directly:
I added theses lines at line 10 of the
langswitcher.html.twig
file{% if langswitcher.page_route == '/' %} {% set lang_url = base_lang_url %} {% else %} {% set lang_url = base_lang_url ~ langswitcher.page_route ~ page.urlExtension %} {% endif %}
work like a charm if include_default_lang: true, many thx @gen035 otherwise if include_default_lang: false, when active now, for example - IT, on link of default language EN, we have link of current active lang IT, and link like - localhost/it - instead - localhost/ maybe i try to found fix later
Pretty sure this has been fixed for a while.
There is problem with the url of the home page for inactive language. A trailing slash is added even if no extension are set in config.
The problem is visible for both
langswitcher.hreflang.html.twig
andlangswitcher.html.twig
:For exemple if
English
page is active it render:and
The problem is also visible on the
url bar
if redirect trailing slash is set to off in config.