add sort order to templates and styles