I want to use collapse data-parent options. I need traditional accordion behavior: all collapsible elements under the specified parent should be closed when a collapsible item is shown. But it doesn't work. I don't know if that's because of my nested collapse or I do something wrong.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div class="content-nav">
<a data-parent="#content-articles" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="content-nav__book_third" href="#content-nav__book_third" class="content-nav__book content-nav__book_third">3</a>
<a data-parent="#content-articles" role="button" data-toggle="collapse" aria-expanded="false" aria-controls="content-nav__book_second" href="#content-nav__book_second" class="content-nav__book content-nav__book_second">2</a>
<a data-parent="#content-articles" role="button" data-toggle="collapse" aria-expanded="true" aria-controls="content-nav__book_first" href="#content-nav__book_first" class="content-nav__book content-nav__book_first">1</a>
</div>
<!--.content-nav-->
<div id="content-articles">
<div id="content-nav__book_third" class="content-article collapse">
<div id="content-article__info_third-1" class="content-article__info collapse">
Book 3 article 1
</div>
<!--.content-article__info-->
<div id="content-article__info_third-2" class="content-article__info collapse">
Book 3 article 2
</div>
<!--.content-article__info-->
<div id="content-article__info_third-3" class="content-article__info collapse">
Book 3 article 3
</div>
<!--.content-article__info-->
<div class="content-article__plan">
<a data-parent="#content-nav__book_third" data-toggle="collapse" aria-expanded="false" aria-controls="content-article__info_third-1" href="#content-article__info_third-1" class="content-article__plan-link content-article__plan-link_third-1">Link - Book 3 article 1</a>
<a data-parent="#content-nav__book_third" data-toggle="collapse" aria-expanded="false" aria-controls="content-article__info_third-2" href="#content-article__info_third-2" class="content-article__plan-link content-article__plan-link_third-2">Link - Book 3 article 2</a>
<a data-parent="#content-nav__book_third" data-toggle="collapse" aria-expanded="false" aria-controls="content-article__info_third-3" href="#content-article__info_third-3" class="content-article__plan-link content-article__plan-link_third-3">Link - Book 3 article 3</a>
</div>
<!--.content-article__plan-->
</div>
<!--.content-article-->
<div id="content-nav__book_second" class="content-article collapse">
<div id="content-article__info_second-1" class="content-article__info collapse">
Book 2 article 1
</div>
<!--.content-article__info-->
<div id="content-article__info_second-2" class="content-article__info collapse">
Book 2 article 2
</div>
<!--.content-article__info-->
<div id="content-article__info_second-3" class="content-article__info collapse">
Book 2 article 3
</div>
<!--.content-article__info-->
<div class="content-article__plan">
<a data-parent="#content-nav__book_second" data-toggle="collapse" aria-expanded="false" aria-controls="content-article__info_second-1" href="#content-article__info_second-1" class="content-article__plan-link content-article__plan-link_second-1">Link - Book 2 article 1</a>
<a data-parent="#content-nav__book_second" data-toggle="collapse" aria-expanded="false" aria-controls="content-article__info_second-2" href="#content-article__info_second-2" class="content-article__plan-link content-article__plan-link_second-2">Link - Book 2 article 2</a>
<a data-parent="#content-nav__book_second" data-toggle="collapse" aria-expanded="false" aria-controls="content-article__info_second-3" href="#content-article__info_second-3" class="content-article__plan-link content-article__plan-link_second-3">Link - Book 2 article 3</a>
</div>
<!--.content-article__plan-->
</div>
<!--.content-article-->
<div id="content-nav__book_first" class="content-article collapse show">
<div id="content-article__info_first-1" class="content-article__info collapse">
Book 1 article 1
</div>
<!--.content-article__info-->
<div id="content-article__info_first-2" class="content-article__info collapse">
Book 1 article 2
</div>
<!--.content-article__info-->
<div id="content-article__info_first-3" class="content-article__info collapse">
Book 1 article 3
</div>
<!--.content-article__info-->
<div class="content-article__plan">
<a data-parent="#content-nav__book_first" data-toggle="collapse" aria-expanded="false" aria-controls="content-article__info_first-1" href="#content-article__info_first-1" class="content-article__plan-link content-article__plan-link_first-1">Link - Book 1 article 1</a>
<a data-parent="#content-nav__book_first" data-toggle="collapse" aria-expanded="false" aria-controls="content-article__info_first-2" href="#content-article__info_first-2" class="content-article__plan-link content-article__plan-link_first-2">Link - Book 1 article 2</a>
<a data-parent="#content-nav__book_first" data-toggle="collapse" aria-expanded="false" aria-controls="content-article__info_first-3" href="#content-article__info_first-3" class="content-article__plan-link content-article__plan-link_first-3">Link - Book 1 article 3</a>
</div>
<!--.content-article__plan-->
</div>
<!--.content-article-->
</div>
<!--#content-articles-->
Probably I had to add some js. But the code should not be redundant.