Skip to main content

Overview

The Pages module allows you to create and manage individual website pages using customizable templates. Build complete pages with structured content, SEO metadata, and publish control.
Pages are different from blog posts - they’re for static website content like About Us, Services, Contact pages, etc.

Key Features

Template-Based

Use pre-defined templates for consistent page layouts

SEO Metadata

Set custom meta titles and descriptions for each page

Publish Control

Publish or unpublish pages with a single toggle

JSON Content

Store flexible content structures in JSON format

Page Structure

{
  "id": 1,
  "title": "About Us",
  "slug": "about-us",
  "template_id": 2,
  "meta_title": "About Grupo Mecsa - Our Story",
  "meta_description": "Learn about our company history and values",
  "content": {
    "sections": [
      {"type": "hero", "title": "Our Story", "image": "about-hero.jpg"},
      {"type": "text", "content": "<p>We are...</p>"}
    ]
  },
  "is_published": true,
  "created_at": "2024-01-15T10:00:00Z",
  "updated_at": "2024-01-20T14:30:00Z"
}

Creating Pages

1

Navigate to Pages

Access Páginas from the sidebar menu.
2

Click 'New Page'

Click the create page button.
3

Fill Page Details

  • Title: Page name
  • Slug: URL-friendly identifier
  • Template: Select page template
  • Meta Title: SEO title
  • Meta Description: SEO description
  • Content JSON: Structured content data
  • Published: Check to make page live
4

Save Page

Submit to create the page record.

Templates

Pages use templates from the Templates module:
pages.php
$template_id = trim($_POST['template_id'] ?? '');
if (!empty($template_id)) {
    $pageData['template_id'] = $template_id;
}

SEO Metadata

pages.php
$pageData = [
    "meta_title" => $meta_title ?: $title,
    "meta_description" => $meta_description,
    // ...
];
Set unique meta titles and descriptions for better search engine optimization.

Publishing Control

pages.php
$is_published = isset($_POST['is_published']) ? true : false;
$pageData['is_published'] = $is_published;
  • Published: Page is live on website
  • Unpublished: Page is draft/hidden

Exporting Pages

Export published pages to static HTML:
pages.php
if (isset($_POST['export_all'])) {
    $export_path = trim($_POST['export_path_all'] ?? '');
    $pages_response = supabase_get("cms_pages?select=*&is_published=eq.true");
    // Export each page to HTML file
}

Database Table

Table: cms_pages
ColumnTypeDescription
idintegerPrimary key
titletextPage title
slugtextURL slug
template_idintegerTemplate FK
meta_titletextSEO title
meta_descriptiontextSEO description
contentjsonbStructured content
is_publishedbooleanPublish status
created_attimestamptzCreated date
updated_attimestamptzModified date

Next Steps

Templates

Design page templates

SEO

Configure SEO settings