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

Template changes to content-page.twig: Added if statement to look for… #942

Merged
merged 7 commits into from
Oct 27, 2023
7 changes: 7 additions & 0 deletions templates/content-edit/entity-moderation-form.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ul class="entity-moderation-form fixed-width">
<li class="entity-moderation-form__item">{{ form.current }}</li>
<li class="entity-moderation-form__item">{{ form.new_state }}</li>
<li class="entity-moderation-form__item">{{ form.revision_log }}</li>
<li class="entity-moderation-form__item">{{ form.submit }}</li>
</ul>
{{ form|without('current', 'new_state', 'revision_log', 'submit') }}
17 changes: 12 additions & 5 deletions templates/layout/page--content-page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'l-region--content'
]
%}

{% set url = url('<current>') %}
{% if node.field_sidebar.0.value == "sidebar" %}
{%
set mainClasses = mainClasses|merge([
Expand All @@ -62,22 +62,26 @@
%}
{% endif %}


<div class="layout-container">
{{ page.header }}
{{ page.breadcrumb }}
{{ page.highlighted }}
{{ page.help }}
{{ page.tabs }}
{# if a side navigation exists the spoof the content region #}
{% if node.field_sidebar.0.value == "sidebar" %}

{# look for url #}
{% set url = url('<current>') %}

{# if a side navigation exists and /'latest' is not in the url then spoof the content region #}
{% if node.field_sidebar.0.value == "sidebar" and '/latest' not in url|render|render %}

<a name="main-content" aria-label="Start of content region"></a>
<main{{ attributes.addClass(mainClasses) }} role="main">
<div class="il-content-with-section-nav section-nav-example">
{{ page.sidebar_first }}
{{ page.sidebar_second }}
<div class="il-content">

{% if node.body %}
{{ drupal_field('body','node', node.id ) }}
{% endif %}
Expand All @@ -97,8 +101,11 @@
{% endfor %}
{{ attach_library('illinois_framework_theme/content-adjust') }}
</main>

{# if a there is no sidebar #}
{% else %}
{{ page.content }}
{{ page.content }}
{% endif %}

{{ page.footer }}
</div>{# /.layout-container #}