Added a "loadTemplate" switch for the loadCmsDocuments() function