patternlab 树枝 drupal8 bootstrap

patternlab twig drupal8 bootstrap

我必须使用 bootstrap 选项卡,然后我想动态生成选项卡链接和选项卡内容。但是每个内容都在一个有机体中。因为在我的例子中,每个选项卡都变成了来自 Drupal 后端的段落包。我不知道是否有办法这样做。如何动态地包含生物体。我不只是没有找到解决这个问题的方法。当然我不能做 if 条件,因为我会有很多案例(选项卡链接和选项卡内容)。代码示例。

<section class="tabs ">
     <div class="container">
      <div class="row">
       <div class="col-12">
        <ul class="nav nav-tabs mx-auto position-relative border-bottom-0 flex-column flex-lg-row justify-content-center pb-0 " id="myTab" role="tablist">
          {% for tab in tabs %}
            <li class="nav-item text-center text-lg-left mx-0  pt-1 px-0 pb-0 pt-lg-2">
              {% include '@atoms/anchor/00-anchor-base.twig' with {anchor: tab, stylemodifier: ''  } %}
            </li>
          {% endfor %}
        </ul>
        <div class="tab-content pt-lg-4 pt-2" id="myTabContent">
          {% for tab in tabs %}
            <div class="tab-pane fade  {{ loop.first ? 'show active' }}" id="{{ tab.controls }}" role="tabpanel" aria-labelledby="{{ tab.controls }}-tab">
               {% include '@organisms/block/11-listing.twig' with { } %}
               {# i want the above organism to be dymin , for example it could be "05-organism-thing.twig" #}
            </div>
          {% endfor %}
        </div>
      </div>
    </div>
  </div>
</section>

实际上你可以用视图来做到这一点。您只需要根据分类法过滤您的内容(选项卡)并创建同一视图的多个块,每个块都基于页面设置下的菜单和路径。更多信息 here.

或者,您可以使用 Quick tabs 模块。

希望对您有所帮助。