Board Thread:Support Requests - Designing Your Wiki/@comment-45256102-20200323202518/@comment-9605025-20200324151932

You should see if what TableWiz mentioned will work for your purposes. However, yes, you can add a navbox via AddRailModule. See the script's documentation for details.

Which wiki did you find the collapsing template on? If they are using custom CSS/JS, then it probably isn't using the standard feature. I would suggest you look into creating your own using the standard feature so that you don't have to deal with the JS.