I'm building a multisite eZ Platforme installation and I need to specify a main layout for my templates. Right now I have a template article.html.twig :
{% extends "main_layout.html.twig" %}
{% block content %}
<h1>{{ ez_render_field(content, 'body') }}</h1>
{% endblock %}
what I want to do is something like this :
{% if(siteaccess = "site1"){
extends "site1_main_layout.html.twig"
}
else if(siteaccess = "site2"){
extends "site1_main_layout.html.twig"
}
%}
Please help me!
You can just configure the layout in the config:
After that, you can just use the following in your full view:
pagelayout
is a variable prepopulated by eZ Platform from the above config based on current siteaccess. It requires eZ Platform 1.2 at the least, I believe.It should also be noted that
pagelayout
variable is available only in full view templates. Other templates wishing to use the configured pagelayout must use the following: