protected final function AddTemplateField()
    {
        $name = 'Template';
        $field = new Select($name, (string) $this->Content()->GetTemplate());
        $field->AddOption('', Trans("Core.ContentForm.$name.Default"));

        $folder = PathUtil::ModuleCustomTemplatesFolder($this->FrontendModule());
        if (Folder::Exists($folder)) {
            $files = Folder::GetFiles($folder);
            foreach ($files as $file) {
                $value = Path::FilenameNoExtension($file);
                $field->AddOption($value, $value);
            }
        }
        $this->AddField($field, false, Trans("Core.ContentForm.$name"));
    }
protected final function AddTemplateField()
    {
        $name = 'Template';
        $field = new Select($name, (string) $this->Content()->GetTemplate());
        $field->AddOption('', Trans("Core.ContentForm.$name.Default"));

        $folder = PathUtil::ModuleCustomTemplatesFolder($this->FrontendModule());
        if (Folder::Exists($folder)) {
            $files = Folder::GetFiles($folder);
            foreach ($files as $file) {
                $value = Path::FilenameNoExtension($file);
                $field->AddOption($value, $value);
            }
        }
        $this->AddField($field, false, Trans("Core.ContentForm.$name"));
    }
protected final function AddTemplateField ( ) { $ name = 'Template' ; $ field = new Select ( $ name , ( string ) $ this -> Content ( ) -> GetTemplate ( ) ) ; $ field -> AddOption ( '' , Trans ( "Core.ContentForm.$name.Default" ) ) ; $ folder = PathUtil :: ModuleCustomTemplatesFolder ( $ this -> FrontendModule ( ) ) ; if ( Folder :: Exists ( $ folder ) ) { $ files = Folder :: GetFiles ( $ folder ) ; foreach ( $ files as $ file ) { $ value = Path :: FilenameNoExtension ( $ file ) ; $ field -> AddOption ( $ value , $ value ) ; } } $ this -> AddField ( $ field , false , Trans ( "Core.ContentForm.$name" ) ) ; }
Adds the template select field
@param FrontendModule $module The module for template selection
Adds the template select field