Either the solution to this could be very simple as I am about to suggest or I may have mis-understood the question.
If you wish to group your links into several categories so that you have the expand collapse capability, you can simply add columns based on those categories in the link web part.
Now create a grouped view based on the category and where ever you wish to display the grouped listing, modify the web part to use that particular view.
It should do the trick.