NO BUG: 2 Tables of content in a page. Bricks 1.12.4: the 2 were rendered, Bricks 2.0: only the second one is rendered

Browser: All
OS: All
URL: Côté Bar – Orléans Jazz Club
Video: Côté Bar – Orléans Jazz Club

[Please describe this bug in as much detail as possible so we can replicate & debug this bug]
After upgrade to Bricks 2, the table of content component doesn’t work as expected when there is 2 TOC in the same page.
The first TOC is not rendered anymore (I tried to move the 2nd TOC to be the first, same behavior).
Ditto by using the id fallback instead of the content selector class.

Example:
Before → Côté Bar – Orléans Jazz Club
After →
https://www.orleansjazzclub.com/cote-bar/

:thinking: Could you be more specific “no bug”?
How do you explain the difference of behaviour between Bricks 1.12.4 and Bricks 2.0?
Did you play the video (first part: Bricks 1.12.4, second part: Bricks 2.0)? Côté Bar – Orléans Jazz Club
Thanks to enlight me

Hi @Shemzone,

You were faster than me :slight_smile: Of course I’ll explain why NO BUG.

Basically, it’s a limitation of the tocbot library; you can check the issue they have opened here: Are multiple tocbot instances (for tabs scenario) possible? · Issue #186 · tscanlin/tocbot · GitHub

So previously, while it did show, it did not work. Now it’s rendered only one.

I hope it’s understandable,
Matej

Hi @Matej and thank you for the answer. I understand that the bug was there in the previous version of Bricks and corrected in the current version.
It’s weird that multiple instances was possible and not anymore now.

I have to think to use an alternative (roll back maybe) as my client seems to be very satisfied with the previous version.

Roll back to the previous version is probably only a temporary solution. Maybe you can find a library that does the same but allows using two TOC elements on the same page?

Matej

1 Like