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'









share|improve this question


























    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'









    share|improve this question
























      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'









      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 11 at 16:06









      Tobbie

      43




      43
























          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>





          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            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

























            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>





            share|improve this answer

























              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>





              share|improve this answer























                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>





                share|improve this answer












                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>






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 12 at 9:42









                Tobbie

                43




                43






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    How to pass form data using jquery Ajax to insert data in database?

                    National Museum of Racing and Hall of Fame

                    Guess what letter conforming each word