generalize display of alerts for profile pages