Support for custom cursor position in templates