Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sidebar to page template #308

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions oe_theme.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ regions:
site_header_secondary: "Site header secondary"
page_header: "Page header"
navigation: "Navigation"
sidebar: "Sidebar"
content: "Content"
footer: "Footer"

Expand Down
9 changes: 8 additions & 1 deletion templates/layout/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/
#}

{% set _main_content_class = page.sidebar ? 'ecl-col-12 ecl-col-lg-9' : 'ecl-col' %}

{% block site_header %}
<header class="ecl-site-header">
{{ page.site_top_bar }}
Expand All @@ -33,7 +35,12 @@
<section class="main-content ecl-u-mv-l">
<div class="ecl-container">
<div class="ecl-row">
<div class="ecl-col">
{% if page.sidebar %}
<div class="ecl-col-12 ecl-col-lg-3">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://ec.europa.eu/component-library/ec/templates/pages/search/code/ this div should be an aside and we should change the main by a section.

{{ page.sidebar }}
</div>
{% endif %}
<div class="{{ _main_content_class }}">
{{ page.content }}
</div>
</div>
Expand Down