patternlab树枝核果8 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>

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

或者,您可以使用快速选项卡模块。

我希望这能有所帮助。

最新更新