Implement sub menu inside a side menu

I’ve been using the default “sidemenu” template, when you create a sidemenu project.
Basically what it should do is, whenever you open the sidemenu and press one of the sub items, it shows the items contained in there.
Would like to know if anyone has an example like that, or would like to clarify what I should do.

Best Regards.