Skip to content

Instantly share code, notes, and snippets.

@lolautruche
Created September 22, 2014 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lolautruche/5b805d071a09f72a8fcf to your computer and use it in GitHub Desktop.
Save lolautruche/5b805d071a09f72a8fcf to your computer and use it in GitHub Desktop.
eZ language switcher and legacy routes
{# Pagelayout from SiteBundle #}
{% block menu %}
{# Assuming you may have your own menu markup here as well #}
{# Defaults to the current route, unless routeRef is already defined #}
{% set routeRef = routeRef|default( ez_route( params={"language": "esl-ES"} ) ) %}
{% endblock %}
{% extends "MySiteBundle::pagelayout.html.twig" %}
{% block menu %}
{# Defining a specific route reference for current legacy module #}
{# You may also add view parameters and/or query parameters #}
{% set routeRef = ez_route( "ez_legacy", {"module_uri": app.request.attributes.get( "semanticPathinfo" )} ) %}
{{ parent() }}
{% endblock %}
parameters:
ezpublish_legacy.my_siteaccess.module_default_layout: "MyLegacyBundle::pagelayout_legacy.html.twig"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment