Hey!
I am trying to set classes when a tab is active with
{% set current_project = (project.active or project.activeChild) ? 'show active' : '' %}
but it does not really work. As I read in the documentation it checks the URL, and since the ID shows, I suspect that this code does not read the ID.
{% extends 'partials/base.html.twig' %}
{% set focus_projects = page.collection('focus_projects') %}
{% block content %}
<div class="row mt-3 px-1">
<div class="col-lg-4">
<div class="card">
<div class="card-body">
<h4 class="card-title">Focus projects</h4>
</div>
<div class="list-group list-group-flush" id="list-tab" role="tablist">
{% for project in focus_projects %}
{% set current_project = (project.active or project.activeChild) ? 'show active' : '' %}
<a href="#{{ project.menu }}" class="list-group-item list-group-item-action flex-column align-items-start {{ current_project }}">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{ project.title }}</h5>
<small>{{ 'MONTHS_OF_THE_YEAR'|ta(project.date|date('n') - 1) }} {{ project.date|date('d') }}</small>
</div>
<p class="mb-1">{{ project.content }}</p>
<small>Category: </small>
</a>
{% endfor %}
</div>
</div>
</div>
<div class="col-8">
<div class="tab-content" id="nav-tabContent">
{% for project in focus_projects %}
{% set current_project = (project.active) ? 'show active' : '' %}
<div class="tab-pane fade {{ current_project }}" id="{{ project.menu }}" role="tabpanel" aria-labelledby="list-{{ project.menu }}-list">{{ project.content }}</div>
{% endfor %}
</div>
</div>
</div>
{% endblock %}