code: protected function createTemplate(Model $model, string $templateName): Template
      {
          if (isset($this->options['template'])) {
              $templateName = $this->options['template'];
          }
  
          if ($model->customTpl) {
              $templateName = $model->customTpl;
          }
  
          $template = $this->get('contao.framework')->createInstance(FrontendTemplate::class, [$templateName]);
          $template->setData($model->row());
  
          return $template;
      }
docs: Creates a template by name or from the "customTpl" field of the model.