0

I am using Bootstrap Barrio sub-theme in a Drupal 8 site. I want to add regions similar to the "featured_*" regions.

The regions are added into the info.yml file

regions:
  # ... origional regions ...
  # new regions
  products_top: 'Products top'
  products_first: 'Products first'
  products_second: 'Products second'
  products_third: 'Products third' 

Add the regions in templates/page.html.twig

    {% if page.products_first or page.products_second or page.products_third %}
      <div class="featured-bottom">
        <aside class="{{ container }} clearfix" role="complementary">
          {{ page.featured_bottom_first }}
          {{ page.featured_bottom_second }}
          {{ page.featured_bottom_third }}
          {{ page.products_first }}
          {{ page.products_second }}
          {{ page.products_third }}
        </aside>
      </div>
    {% endif %}

After applied the theme, I found page.featured_* and page.products_* regions are different:

<div class="featured-bottom">
        <aside class="container clearfix" role="complementary">
          <div class="block-region demo-block">Featured bottom first</div>
          <div class="block-region demo-block">Featured bottom second</div>
          <div class="block-region demo-block">Featured bottom third</div>
  <section class="row region region-products-first">
    <div class="block-region demo-block">Products first</div>
  </section>
  <section class="row region region-products-second">
    <div class="block-region demo-block">Products second</div>
  </section>
  <section class="row region region-products-third">
    <div class="block-region demo-block">Products third</div>
  </section>

        </aside>
      </div>

Why are they different?

New contributor
chsunsh is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

chsunsh is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.