packageGen viewTemplateIndex updated, script section added