Build a website with the Enonic Site Framework
Contents
This step-by-step tutorial introduces the Enonic Site Framework, the built-in way to build content-driven websites on Enonic XP. You’ll render content with pages, parts, and layouts, and compose and publish the result in Content Studio.
Intro
With the Enonic Site Framework, Enonic XP renders your site itself. For each request, XP finds the content, resolves its page, and runs your server-side JavaScript controllers and HTML templates to produce the response. Editors compose the pages visually in Content Studio, using the components you build.
When you are done, a country page on your site will look something like this:
You will complete the following steps:
-
Set up the CLI, a local sandbox, and your own app
-
Explore the sample content and its content types in Content Studio
-
Render content with a page component
-
Open the page to editors with regions
-
Add parts that render and list content
-
Reuse a page across content items with page templates
-
Serve CSS and images as static assets
-
Arrange components in columns with layouts
-
Publish the site
The content types, regions, and page templates you meet here are concepts of the CMS and apply whichever front-end you use. The controllers and views are specific to the Site Framework.
| Enonic also supports other front-end frameworks. Next.js renders outside XP and fetches content through the API. React4XP runs inside XP like the Site Framework, but replaces its page rendering with one based on React. |
| Throughout this tutorial, "XP" refers to "Enonic XP", the platform behind Enonic. |
Prerequisites
No prior Enonic experience is required. Basic familiarity with HTML and JavaScript or TypeScript is helpful.
To follow this tutorial you will need:
-
A terminal
-
Your favorite text or code editor
-
Node.js with
npmif you want to install the Enonic CLI vianpm(other installers are also available)
You will install the Enonic CLI in the first chapter.
Tested versions
This version of the tutorial was produced and tested with the following stack:
| Component | Version |
|---|---|
|
Enonic CLI |
4.1.4 |
|
Enonic XP |
7.16.11 |
|
Content Studio |
5.4.17 |
Get started by setting up your developer environment.