add new template method for truncating text