add support for optional template fragments