updated TemplateScript for sidebar portlet changes.