Hello everybody ♪
I have blog section with a collection of posts in FR, JA, and EN.
For each post, I have a blog.fr.md, a blog.ja.md and a blog.en.md.
If the post exist in the three languages, perfect.
When the post A exists in FR but not in JA and EN, the header of blog.ja.md and blog.en.md is set tovisible and hidden and so there is no display in navigation menu and in content.
Problem arrives at post level only with multilangual selector, langswitcher.
When I am reading a post A and I use the multilingual selector to change to JA or EN, I am redirected to the corresponding url adress of post A in JA or in EN ... [blog.ja.md and blog.en.md]
BUT As parameter is set to visible and hidden ... I get an error.
So my question:
How to program the multiligual selector langswitcher so that when post A is not AND visible AND hidden in JA and AN, JA and AN do not appear in the multilinguage selector langswitcher ?
Please, forgive my lack of technical knoledge to achive this issue by myself.
Here the code of the multilingual selector langswitcher for information.
---html
{% set langobj = grav['language'] %}
<li id="langswitcher" class="active"><a>[{{ langswitcher.current }}] <i class="fa fa-caret-down fa-lg"></i></a>
<ul>
{% for key, language in langswitcher.languages %}
{% if key == langswitcher.current %}
{% set lang_url = page.url %}
{% set active_class = 'active' %}
{% else %}
{% set lang_url = base_url_simple ~ langobj.getLanguageURLPrefix(key)~langswitcher.page_route ?: '/' %}
{% set active_class = '' %}
<li><a href="{{ lang_url }}" class="{{ active_class }}">[{{ key }}] {{ language.nativeName }}</a></li>
{% endif %}
{% endfor %}
</ul>
</li>
I guess it's possible to have that element thrue the call of a collection like in the documentation, but I am not able to write it correctly yet.
Thanks in advance for your help ☆
tidivoit