XperienceCommunity.DotnetItemTemplates
2.0.0
dotnet new install XperienceCommunity.DotnetItemTemplates::2.0.0
Xperience Community: .NET Item Templates
.NET CLI Item Templates for Xperience by Kentico projects, usable at the command line or in Visual Studio
These templates have been tested up to Xperience by Kentico v29.3.3.
Note: the templates might work on earlier versions of Xperience, but have only been tested for the version above.
Setup
Install
Install the XperienceCommunity.DotnetItemTemplates NuGet Template package globally:
dotnet new install XperienceCommunity.DotnetItemTemplates
Or, update the templates to the latest version if you already have them installed
dotnet new update
Use
Use the templates in Visual Studio or at the command line:
dotnet new xpc-page-builder-widget -n HeroWidget -o .\MySite.Web\Components\Widgets
This will generate a new folder automatically: .\MySite.Web\Components\Widgets\Hero containing the following files:
HeroWidget.csHero.cshtml
To view the list of all the templates that are installed with this package run dotnet new list at the command line.
Screenshots


Templates
This package includes the following item templates.
Required Suffix
Note: Each template has a required suffix for the name of the item you are scaffolding. You can use any name you want as long as you include the suffix at the end of the name.
Admin
-
Required suffix
AdminModuledotnet new xpc-admin-module -n AppleAdminModule -o .\App.Admin\ApplesGenerates
.\App.Admin\Apples\AppleAdminModule.cs
-
Required suffix
ApplicationPagedotnet new xpc-admin-application-page -n AppleApplicationPage -o .\App.Admin\ApplesGenerates
.\App.Admin\Apples\AppleApplicationPage.cs
-
Required suffix
EditPagedotnet new xpc-admin-edit-page -n AppleEditPage -o .\App.Admin\ApplesGenerates
.\App.Admin\Apples\AppleEditPage.cs
-
Required suffix
EditSectionPagedotnet new xpc-admin-edit-section-page -n AppleEditSectionPage -o .\App.Admin\ApplesGenerates
.\App.Admin\Apples\AppleEditSectionPage.cs
-
Required suffix
ListPagedotnet new xpc-admin-list-page -n AppleListPage -o .\App.Admin\ApplesGenerates
.\App.Admin\Apples\AppleListPage.cs
-
Required suffix
CreatePagedotnet new xpc-admin-create-page -n AppleCreatePage -o .\App.Admin\ApplesGenerates
.\App.Admin\Apples\AppleCreatePage.cs
-
Required suffix
PageExtenderdotnet new xpc-admin-page-extender -n ApplePageExtender -o .\App.Admin\ApplesGenerates
.\App.Admin\Apples\ApplePageExtender.cs
-
Required suffix
FormComponentdotnet new xpc-admin-ui-form-component -n AppleFormComponent -o .\App.Admin\ApplesGenerates
.\App.Admin\Apples\AppleFormcomponent.cs
Admin UI Form Component (TSX))
Required suffix
FormComponentdotnet new xpc-admin-ui-form-component -lang TypeScript -n AppleFormComponent -o .\App.Admin\Client\src\applesGenerates
.\App.Admin\Client\src\apples\AppleFormComponent.tsx
-
Required suffix
ValidationRuledotnet new xpc-admin-validation-rule -n FreshAppleValidationRule -o .\App.Admin\ApplesGenerates
.\App.Admin\Apples\FreshAppleValidationRule.cs
-
Required suffix
ValidationRuledotnet new xpc-admin-validation-rule -lang TypeScript -n AppleValidationRule -o .\App.Admin\Client\src\applesGenerates
.\App.Admin\Client\src\apples\AppleValidationRule.tsx
Form Builder
-
Required suffix
FormComponentdotnet new xpc-form-builder-form-component -n AppleFormComponent -o .\App.Web\Components\FormComponentsGenerates
.\App.Web\Components\FormComponents\Apple\AppleFormComponent.cs.\App.Web\Components\FormComponents\Apple\Apple.cshtml
-
Required suffix
FormSectiondotnet new xpc-form-builder-form-section -n AppleFormSection -o .\App.Web\Components\FormSectionsGenerates
.\App.Web\Components\FormSections\Apple\AppleFormSection.cs.\App.Web\Components\FormSections\Apple\Apple.cshtml
Page Builder
-
Required suffix
Widgetdotnet new xpc-page-builder-widget -n AppleWidget -o .\App.Web\Components\WidgetsGenerates
.\App.Web\Components\Widgets\Apple\AppleWidget.cs.\App.Web\Components\Widgets\Apple\Apple.cshtml
-
Required suffix
Sectiondotnet new xpc-page-builder-section -n AppleSection -o .\App.Web\Components\SectionsGenerates
.\App.Web\Components\Sections\Apple\AppleSection.cs.\App.Web\Components\Sections\Apple\Apple.cshtml
Building and Testing
Automated
Run the templates: reinstall VS Code task, which will perform all the manual steps below
Manual
- Make template changes
- Run the
dotnet: buildVS Code task to ensure the template changes compile - Run the
dotnet: packVS Code task to package the templates - Close all instances of VS
- Run the
dotnet: uninstall templateVS Code task to uninstall the template, if already installed - Run the
templates: clear cacheVS Code task to clear the template cache - Run the
dotnet: install templateVS Code task to install the locally packaged template (use the correct version number when prompted) - Open VS and test the templates on an ASP.NET Core or class library project
Notes
- Exposing Item Tempaltes in VS
- Interactive dotnet new experiences
- Guidance on authoring .NET CLI templates
- Templating repo and wiki
- Example templates for ASP.NET Core
Contributions
If you discover a problem, please open an issue.
If you would like contribute to the code or documentation, please open a pull request.
Please refer to the Code of Conduct when contributing to or opening issues for this repository.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 350 | 8/18/2024 |
| 2.0.0-prerelease-8-1 | 272 | 8/18/2024 |
| 1.0.3 | 912 | 7/9/2023 |
| 1.0.3-prerelease-6-1 | 446 | 7/9/2023 |
| 1.0.2 | 357 | 7/8/2023 |
| 1.0.2-prerelease-5-1 | 466 | 7/8/2023 |
| 1.0.1 | 410 | 7/8/2023 |
| 1.0.1-prerelease-4-1 | 427 | 7/8/2023 |
| 1.0.0 | 379 | 7/8/2023 |