sidebar region content showing below main content in drupal 8
up vote
0
down vote
favorite
I created a custom theme in drupal 8.6. Everything works fine but for some reason if I put a content in my sidebar region it goes to the bottom of my page after my main content. Any suggestions on how to fix this would be highly appreciated. Thanks
Here is my page.html.twig
<div class="layout-container">
<header role="banner">
{{ page.header }}
</header>
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
{% if page.sidebar %}
<aside class="layout-sidebar-first" role="complementary">
{{ page.sidebar }}
</aside>
{% endif %}
</main>
{% if page.footer %}
<footer role="contentinfo">
{{ page.footer }}
</footer>
{% endif %}
</div>{# /.layout-container #}
st_saviours.info.yml file
name: St Saviours
description: Drupal 8 theme
type: theme
core: 8.x
libraries:
- st_saviours/global-css
- st_saviours/global-js
stylesheets-remove:
- core/themes/stable/css/views/views.module.css
- core/themes/stable/css/system/components/align.module.css
regions:
header : 'Header'
content: 'Main Content'
footer: 'Footer'
sidebar : 'Sidebar'
twig yaml drupal-8
add a comment |
up vote
0
down vote
favorite
I created a custom theme in drupal 8.6. Everything works fine but for some reason if I put a content in my sidebar region it goes to the bottom of my page after my main content. Any suggestions on how to fix this would be highly appreciated. Thanks
Here is my page.html.twig
<div class="layout-container">
<header role="banner">
{{ page.header }}
</header>
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
{% if page.sidebar %}
<aside class="layout-sidebar-first" role="complementary">
{{ page.sidebar }}
</aside>
{% endif %}
</main>
{% if page.footer %}
<footer role="contentinfo">
{{ page.footer }}
</footer>
{% endif %}
</div>{# /.layout-container #}
st_saviours.info.yml file
name: St Saviours
description: Drupal 8 theme
type: theme
core: 8.x
libraries:
- st_saviours/global-css
- st_saviours/global-js
stylesheets-remove:
- core/themes/stable/css/views/views.module.css
- core/themes/stable/css/system/components/align.module.css
regions:
header : 'Header'
content: 'Main Content'
footer: 'Footer'
sidebar : 'Sidebar'
twig yaml drupal-8
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I created a custom theme in drupal 8.6. Everything works fine but for some reason if I put a content in my sidebar region it goes to the bottom of my page after my main content. Any suggestions on how to fix this would be highly appreciated. Thanks
Here is my page.html.twig
<div class="layout-container">
<header role="banner">
{{ page.header }}
</header>
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
{% if page.sidebar %}
<aside class="layout-sidebar-first" role="complementary">
{{ page.sidebar }}
</aside>
{% endif %}
</main>
{% if page.footer %}
<footer role="contentinfo">
{{ page.footer }}
</footer>
{% endif %}
</div>{# /.layout-container #}
st_saviours.info.yml file
name: St Saviours
description: Drupal 8 theme
type: theme
core: 8.x
libraries:
- st_saviours/global-css
- st_saviours/global-js
stylesheets-remove:
- core/themes/stable/css/views/views.module.css
- core/themes/stable/css/system/components/align.module.css
regions:
header : 'Header'
content: 'Main Content'
footer: 'Footer'
sidebar : 'Sidebar'
twig yaml drupal-8
I created a custom theme in drupal 8.6. Everything works fine but for some reason if I put a content in my sidebar region it goes to the bottom of my page after my main content. Any suggestions on how to fix this would be highly appreciated. Thanks
Here is my page.html.twig
<div class="layout-container">
<header role="banner">
{{ page.header }}
</header>
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
{% if page.sidebar %}
<aside class="layout-sidebar-first" role="complementary">
{{ page.sidebar }}
</aside>
{% endif %}
</main>
{% if page.footer %}
<footer role="contentinfo">
{{ page.footer }}
</footer>
{% endif %}
</div>{# /.layout-container #}
st_saviours.info.yml file
name: St Saviours
description: Drupal 8 theme
type: theme
core: 8.x
libraries:
- st_saviours/global-css
- st_saviours/global-js
stylesheets-remove:
- core/themes/stable/css/views/views.module.css
- core/themes/stable/css/system/components/align.module.css
regions:
header : 'Header'
content: 'Main Content'
footer: 'Footer'
sidebar : 'Sidebar'
twig yaml drupal-8
twig yaml drupal-8
asked Nov 11 at 16:06
Tobbie
43
43
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I used bootstrap grid layout to arrange the main content and the sidebar in my page.html.twig file.
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="col-md-12">
<div class="row">
{% if (page.first_sidebar and page.second_sidebar) %}
<div class="col-md-4">
<aside class="layout-sidebar-first" role="complementary">
{{ page.first_sidebar }}
</aside>
</div>
<div class="col-md-5">
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
</div>
<div class="col-md-3">
<aside class="layout-sidebar-second" role="complementary">
{{ page.second_sidebar }}
</aside>
</div>
{% else %}
<div class="col-md-12">
<div class="row">
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
</div>
</div>
{% endif %}
</div>
</div>
</main>
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I used bootstrap grid layout to arrange the main content and the sidebar in my page.html.twig file.
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="col-md-12">
<div class="row">
{% if (page.first_sidebar and page.second_sidebar) %}
<div class="col-md-4">
<aside class="layout-sidebar-first" role="complementary">
{{ page.first_sidebar }}
</aside>
</div>
<div class="col-md-5">
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
</div>
<div class="col-md-3">
<aside class="layout-sidebar-second" role="complementary">
{{ page.second_sidebar }}
</aside>
</div>
{% else %}
<div class="col-md-12">
<div class="row">
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
</div>
</div>
{% endif %}
</div>
</div>
</main>
add a comment |
up vote
0
down vote
I used bootstrap grid layout to arrange the main content and the sidebar in my page.html.twig file.
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="col-md-12">
<div class="row">
{% if (page.first_sidebar and page.second_sidebar) %}
<div class="col-md-4">
<aside class="layout-sidebar-first" role="complementary">
{{ page.first_sidebar }}
</aside>
</div>
<div class="col-md-5">
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
</div>
<div class="col-md-3">
<aside class="layout-sidebar-second" role="complementary">
{{ page.second_sidebar }}
</aside>
</div>
{% else %}
<div class="col-md-12">
<div class="row">
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
</div>
</div>
{% endif %}
</div>
</div>
</main>
add a comment |
up vote
0
down vote
up vote
0
down vote
I used bootstrap grid layout to arrange the main content and the sidebar in my page.html.twig file.
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="col-md-12">
<div class="row">
{% if (page.first_sidebar and page.second_sidebar) %}
<div class="col-md-4">
<aside class="layout-sidebar-first" role="complementary">
{{ page.first_sidebar }}
</aside>
</div>
<div class="col-md-5">
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
</div>
<div class="col-md-3">
<aside class="layout-sidebar-second" role="complementary">
{{ page.second_sidebar }}
</aside>
</div>
{% else %}
<div class="col-md-12">
<div class="row">
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
</div>
</div>
{% endif %}
</div>
</div>
</main>
I used bootstrap grid layout to arrange the main content and the sidebar in my page.html.twig file.
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="col-md-12">
<div class="row">
{% if (page.first_sidebar and page.second_sidebar) %}
<div class="col-md-4">
<aside class="layout-sidebar-first" role="complementary">
{{ page.first_sidebar }}
</aside>
</div>
<div class="col-md-5">
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
</div>
<div class="col-md-3">
<aside class="layout-sidebar-second" role="complementary">
{{ page.second_sidebar }}
</aside>
</div>
{% else %}
<div class="col-md-12">
<div class="row">
<div class="layout-content">
{{ page.content }}
</div>{# /.layout-content #}
</div>
</div>
{% endif %}
</div>
</div>
</main>
answered Nov 12 at 9:42
Tobbie
43
43
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250578%2fsidebar-region-content-showing-below-main-content-in-drupal-8%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown