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.cs
Hero.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
AdminModule
dotnet new xpc-admin-module -n AppleAdminModule -o .\App.Admin\Apples
Generates
.\App.Admin\Apples\AppleAdminModule.cs
-
Required suffix
ApplicationPage
dotnet new xpc-admin-application-page -n AppleApplicationPage -o .\App.Admin\Apples
Generates
.\App.Admin\Apples\AppleApplicationPage.cs
-
Required suffix
EditPage
dotnet new xpc-admin-edit-page -n AppleEditPage -o .\App.Admin\Apples
Generates
.\App.Admin\Apples\AppleEditPage.cs
-
Required suffix
EditSectionPage
dotnet new xpc-admin-edit-section-page -n AppleEditSectionPage -o .\App.Admin\Apples
Generates
.\App.Admin\Apples\AppleEditSectionPage.cs
-
Required suffix
ListPage
dotnet new xpc-admin-list-page -n AppleListPage -o .\App.Admin\Apples
Generates
.\App.Admin\Apples\AppleListPage.cs
-
Required suffix
CreatePage
dotnet new xpc-admin-create-page -n AppleCreatePage -o .\App.Admin\Apples
Generates
.\App.Admin\Apples\AppleCreatePage.cs
-
Required suffix
PageExtender
dotnet new xpc-admin-page-extender -n ApplePageExtender -o .\App.Admin\Apples
Generates
.\App.Admin\Apples\ApplePageExtender.cs
-
Required suffix
FormComponent
dotnet new xpc-admin-ui-form-component -n AppleFormComponent -o .\App.Admin\Apples
Generates
.\App.Admin\Apples\AppleFormcomponent.cs
Admin UI Form Component (TSX))
Required suffix
FormComponent
dotnet new xpc-admin-ui-form-component -lang TypeScript -n AppleFormComponent -o .\App.Admin\Client\src\apples
Generates
.\App.Admin\Client\src\apples\AppleFormComponent.tsx
-
Required suffix
ValidationRule
dotnet new xpc-admin-validation-rule -n FreshAppleValidationRule -o .\App.Admin\Apples
Generates
.\App.Admin\Apples\FreshAppleValidationRule.cs
-
Required suffix
ValidationRule
dotnet new xpc-admin-validation-rule -lang TypeScript -n AppleValidationRule -o .\App.Admin\Client\src\apples
Generates
.\App.Admin\Client\src\apples\AppleValidationRule.tsx
Form Builder
-
Required suffix
FormComponent
dotnet new xpc-form-builder-form-component -n AppleFormComponent -o .\App.Web\Components\FormComponents
Generates
.\App.Web\Components\FormComponents\Apple\AppleFormComponent.cs
.\App.Web\Components\FormComponents\Apple\Apple.cshtml
-
Required suffix
FormSection
dotnet new xpc-form-builder-form-section -n AppleFormSection -o .\App.Web\Components\FormSections
Generates
.\App.Web\Components\FormSections\Apple\AppleFormSection.cs
.\App.Web\Components\FormSections\Apple\Apple.cshtml
Page Builder
-
Required suffix
Widget
dotnet new xpc-page-builder-widget -n AppleWidget -o .\App.Web\Components\Widgets
Generates
.\App.Web\Components\Widgets\Apple\AppleWidget.cs
.\App.Web\Components\Widgets\Apple\Apple.cshtml
-
Required suffix
Section
dotnet new xpc-page-builder-section -n AppleSection -o .\App.Web\Components\Sections
Generates
.\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: build
VS Code task to ensure the template changes compile - Run the
dotnet: pack
VS Code task to package the templates - Close all instances of VS
- Run the
dotnet: uninstall template
VS Code task to uninstall the template, if already installed - Run the
templates: clear cache
VS Code task to clear the template cache - Run the
dotnet: install template
VS 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 | 136 | 8/18/2024 |
2.0.0-prerelease-8-1 | 99 | 8/18/2024 |
1.0.3 | 704 | 7/9/2023 |
1.0.3-prerelease-6-1 | 249 | 7/9/2023 |
1.0.2 | 148 | 7/8/2023 |
1.0.2-prerelease-5-1 | 266 | 7/8/2023 |
1.0.1 | 200 | 7/8/2023 |
1.0.1-prerelease-4-1 | 227 | 7/8/2023 |
1.0.0 | 177 | 7/8/2023 |