Add a templating function for option list