Make langswitcher plugin clickable on a modular menu

☆ Here is the following navigation bar of a modular page
—html
{% block header_navigation %}
{% if show_onpage_menu %}


    {% for module in page.collection() %}
    {% set current_module = (module.active or module.activeChild) ? ‘active’ : ‘’ %}
  • {{ module.menu }}

  • {% endfor %}
    {% for mitem in site.menu %}


  • {% if mitem.icon %}{% endif %}
    {{ mitem.text }}


  • {% endfor %}
    {% if config.plugins.langswitcher.enabled %},{% include ‘partials/navbar_langswitcher.html.twig’ %},{% endif %}

{% else %}
{{ parent() }}
{% endif %}
{% endblock %}

with langswitcher inserted just before </ul>.

Everything displays very well BUT  while link is correct (it's working if open in another tab) onclick is _not_ possible.

Is it a matter of CSS? And if so can I avoid it by custom.scss?

Thank in advance for your help ♪

Sounds like a CSS issue, but it depends on how your navbar_langswitcher.html.twig looks like. The first thing is to check, whether your custom template generates valid markup meaning only list <li> elements. Otherwise you may get invalid markup and this can be the reason for your issue.

[ I am becoming crazy! ]

♪ This how nav_langswitcher.html.twig looks like…
—html
{% set langobj = grav[‘language’] %}

  • [{{ langswitcher.current }}]

      {% 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 = ‘’ %}
    • [{{ key }}] {{ language.nativeName }}

    • {% endif %}
      {% endfor %}

  • Thank you very in advance for your help ☆

    ♪ There is not only <li>elements but also <ul> elements.
    Is it not a CSS issue but a JS thing as for modular there is an additional script JSingleNav?
    The navigation bar under modular works with JSingleNav as an anchor and langswitcher code do not point an anchor but a link?
    Please help ☆

    ♪ Thanks in advance for your help solving this issue ☆

    ♪ Thank you in advance for your help solving this issue ☆

    ♪ Thank you in advance for your help solving this issue ☆

    @hexplor
    Hello Karol
    I have a problem for a long time now and I have seen your answer in http://getgrav.org/forum#!/general:modular-page-navigation
    I am currently facing another issue with modular menu
    It is slightly different because it’s involving the langswitcher plugin.
    Technically speaking, I am doing my best, but yet I am not able to reach the solving point.
    Thank you in advance if you can help

    Ok I got that it’s the additional script JSingleNav that is transforming regular menu bar into modular menu bar and is also tranforming links into ancor.
    I would like to make an exception just for template langswitcher

    Ok this issue is solved ♪
    It was a CSS issue
    (I apologize to @Sommerregen)

    I don’t really know how I did, but I just add a navigationclass to nav_langswitcher.html.twig and that was it !
    Here is the code (modification is second line from top):
    —html
    {% set langobj = grav[‘language’] %}

  • [{{ langswitcher.current }}]

      {% 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 = ‘’ %}
    • [{{ key }}] {{ language.nativeName }}

    • {% endif %}
      {% endfor %}

  • 
    ☆ Hurrahhh, hurrahh !!!! ♪
    
    Long life to Grav ...

    This issue is NOT solved.
    It appeared to be solved ONLY because I had erased the JSingleNav script in modular.html.twig.
    With SCRIPT, then IMPOSSIBLE TO CLICK On the /JA link on nav_langswitcher
    All my apologies for not been able to solve that issue yet…

    OK

    I finally found THE solution looking at the documentation of JSingleNav


    and the Demo
    http://chriswojcik.net/demos/single-page-nav/

    It appear that there is a class called ‘external’ in this script and that it makes possible to escape from the script.

    I feel stupid and would like to apologize…

    Hope that the solution will help others

    Hurrah though as I reached that point I have been willing to reach for about a week now ♪

    Grav is a fantastic tool: thank you ☆