I am creating a product gallery for one of our clients and have a tabbed gallery with a tab-navbar element that determines which content is loaded in the gallery.
The tab/navbar is code as such:
<!-- Begin Tab Navbar -->
<ul class="nav nav-tabs row g-2 d-flex nav-fill" data-aos="fade-up" data-aos-delay="100" role="tablist">
{% for tab in data.tabs %}
<li class="nav-item col-2" role="presentation">
<a class="{{ loop.first ? 'nav-link active' : 'nav-link' }}" data-bs-toggle="tab" data-bs-target="#tabs-tab-{{loop.index}}" aria-selected="{{ loop.first ? 'true' : 'false' }}" role="tab" tabindex="-1">
<h4>{{ tab.title }}</h4>
</a>
</li><!-- End tab nav item -->
{% endfor %}
</ul>
<!-- End Tab Navbar -->
Which ties to the tab-content, the intial portion of which is written as follows:
<div class="tab-content" data-aos="fade-up" data-aos-delay="200">
{% for tab in data.tabs %}
<div class="tab-pane fade {{ loop.first ? 'show active' : '' }}" id="tabs-tab-{{loop.index}}" role="tabpanel">
<div class="row">
<div class="col-lg-6 order-2 order-lg-1 mt-3 mt-lg-0 d-flex flex-column justify-content-center">
<h6>{{ tab.category }}</h6>
<h3>{{ tab.title }}</h3>
{{ tab.description|raw }}
The problem I’m running into is when I click on the tabs they no longer switch the content. They worked fine before I converted it to a partial.
Is there no way to have the variable “nav-link active” and “aria-selected=“true”” set statically? It seems like its being dynamically overridden preventing the buttons from working.