Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23516

Language switcher and legacy module

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2014.11, 5.4.0-beta1, 5.3.4
    • 2014.07, 5.3.3
    • Language
    • None

    Description

      Hi,

      I insert language switcher in my page_header.html.twig as described in the documentation https://doc.ez.no/display/EZP/Language+Switcher
      and defined my pagelayout.html.twig to display legacy modules (content/search for example).
      But it raise an error when displaying the page content/search :

      An exception has been thrown during the rendering of a template ("When generating an eZ Publish legacy fallback route, "uri" parameter must be provided.") in EzConsultingBundle:Language:switcher.html.twig at line 17.

      And this is my template twig :

      <div id="lang-selector">
          {% for lang in ezpublish.availableLanguages %}
              {# This time, we alter the "siteaccess" parameter directly. #}
              {# We get the right siteaccess with the help of ezpublish.translationSiteAccess() helper #}
      
              {% do routeRef.set( "siteaccess", ezpublish.translationSiteAccess( lang ) ) %}
              {% if lang != currentLanguage %}
                  <a href="{{ url( routeRef ) }}" title="Switch to {{ siteaccess[lang] }}">
                      <img src="{{ asset( '/share/icons/flags/' ~ lang ~ '.gif' ) }}" title="{{ lang }}">
                      {{ siteaccess[lang]}}
                  </a>
              {% endif %}
          {% endfor %}
      </div>
      

      It seems that in the variable routeRef sent to the template, "route" is set to "ez_legacy" and there is not any "params.parameters".

      Attachments

        Activity

          People

            Unassigned Unassigned
            Florent.Huck-obsolete@ez.no Florent Huck (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: