[Sugester V2 EN](https://sugester.intum.pl/kb/sugester-v2-en.md) / [CMS](https://sugester.intum.pl/kb/sugester-v2-en/cms.md)

# [Introduction to CMS](https://sugester.intum.pl/kb/sugester-v2-en/introduction-to-cms.md)

The CMS in Sugester 2 allows you to create marketing pages, landing pages, and documentation without writing backend code. The system is based on Liquid templates.

## CMS Structure

The CMS consists of four main elements:

### 1. Site
The main container for pages. Each site can have:
- Its own domain (e.g., mojafirma.pl)
- Its own default layout
- A set of pages

### 2. Layout
An HTML template with Liquid that defines the structure of the page:
- Header and footer
- Navigation menu
- CSS styles
- SEO meta tags
- Placeholder for content (`{% for p in paragraphs %}{{ p }}{% endfor %}`)

### 3. Page
A single page with:
- URL path (e.g., `/dashboard`, `/en`)
- Fields - variables available in the layout
- Assigned paragraphs

### 4. Paragraph
A block of HTML content assigned to a page:
- Hero, features, pricing, contact sections
- Priority determines the display order
- Can be assigned to multiple pages

## Data Flow

```
Domain → Site → Page → Layout + Paragraphs → Rendered page
         ↓
      fields (variables)
```

## Example

For the page `https://mojafirma.pl/dashboard`:
1. The domain `mojafirma.pl` points to Site `MojaFirma-marketing`
2. The path `/dashboard` maps to a Page with path `Dashboard`
3. The Page has fields: `{lang: 'pl', product: 'Dashboard', title: '...'}` 
4. The Layout renders HTML with these variables
5. Paragraphs insert content in place of `{{ p }}`

## API Endpoints

<table>
<tr><th>Resource</th><th>Endpoint</th></tr>
<tr><td>Sites</td><td><code>/cms/sites.json</code></td></tr>
<tr><td>Layouts</td><td><code>/cms/layouts.json</code></td></tr>
<tr><td>Pages</td><td><code>/cms/pages.json</code></td></tr>
<tr><td>Paragraphs</td><td><code>/cms/paragraphs.json</code></td></tr>
</table>
Each endpoint supports CRUD operations with an API token.