This repository helps you to get started with the development of MVC page builder components. It contains an ASP.NET Core application with a sample widget, inline editor, form component, and section. The application needs to be connected to an instance of the Xperience administration application to work properly.
To learn about best practices and development guidelines for MVC page builder components, visit respective pages in the Xperience Documentation:
To provide a better front-end development experience for the components, a basic Webpack configuration with npm, TypeScript, and less pre-processor support has been pre-configured. The front-end source files of components are located in the Assets
folder by default. You can configure this location in wepback/constants.js
file, alongside with the component's entry file name. By default, the name is main.ts
or main.less
for components that don't require custom javascript code, e.g. Sections.
To start with the component development, run the npm run dev
command. Webpack then automatically searches for changes in the source files and transpiles them in the Sandbox site's wwwroot
folder, where they're automatically detected by the components system bundles.
If you want to build component scripts for production use, run the npm run build
command. This generates both minified and non-minified versions of the production scripts inside the components Content
folder (e.g. MyCompany.Components/Content
).
-
Download the Xperience installer, if you do not have one already.
-
To install the Xperience administration application without any site from the command line:
-
Run the installer and use the
XperienceInstallationProfile.xml
XML configuration.- Specify the location where Xperience is installed by defining the
TargetFolder
attribute of theIIS
element. (warning: Do not use the location where your installer.exe
file is located) - To modify the connection to a different database server, configure the
SQL
element in the configuration XML file. - To add a license to the Xperience instance, adjust the
Licenses
element in the configuration XML file.
.\Xperience_13_0_trial.exe XperienceInstallationProfile.xml
- Specify the location where Xperience is installed by defining the
-
If the installer notifies you that there are program files already installed in your system, run the following command to uninstall current Xperience program files and then rerun the previous installation command.
.\Xperience_13_0_trial.exe /u
-
-
Open the administration interface (already registered in IIS with
_Admin
suffix) in your preferred browser and import the site export package (SandboxSite.zip
). The package contains:- Site (with configured Presentation URL and routing mode set to the content tree-based)
- Page type (with Page builder and URL features enabled)
- A page based on this page type
- Web farm mode set to Automatic
-
Clone this repository (MVC application) to a different folder than the Xperience administration interface.
git clone https://github.com/Kentico/xperience-component-starter
-
Rename the
appsettings.Development.template
file toappsettings.Development.json
and set both the connection string (CMSConnectionString
) and the hash string salt (CMSHashStringSalt
) to match the connection string and the hash string salt in theweb.config
application settings of the Xperience administration interface. -
In the Visual Studio:
- Open the
MvcComponentStarter.sln
solution. - Restore NuGet packages for all projects in the solution.
- Build the solution.
- Open the
-
Download and install the latest NodeJS runtime.
-
Navigate to the root of this MVC project using console and install missing npm packages:
npm install
-
Start a DEV server for serving transpiled JavaScript files:
npm run dev
-
In the Visual Studio:
- Run the SandboxSite application; Select the project and press the F5 key.
The page builder is now set up and ready to be used. To navigate to a page with the page builder:
- Open the administration interface in your preferred browser.
- Navigate to the Pages application.
- Select the page named
Home
in the content tree.
You can now see the page builder interface set up and ready to be used. You can develop further components by following the links from the list at the top of the page.