Opening a specific dropdown dynamically (with CMS)

Hi there!

I’m looking to create the same type of dropdown functionality that is seen in the Webflow University. Where the “Current Lesson” is shown in the dropdown menu on the left.

So the menu is expanded to show just the area where that CMS item is (screenshot below).

I each Dropdown I’m using as a CMS Category, and have that Category linked on the CMS item (like the Lesson on the Webflow Uni).

I’m unsure what code would be needed to automatically open the relevant category dropdown that the current CMS item is part of.

If anyone has ideas on how to achieve this that would be super helpful!
Thanks!