The menu bar in CMS admin will automatically update to add template pages when you click the plus button to add a page under a template.
The recordset query I gave is to get the list of pages from a template into a recordset. From there you can use that recordset however you need... you would use that sql statement to create a recordset and use that recordset to do whatever you need to do.