menu_book Navigation menu

Page Creation

Page creation in Pragma CMS relies on a decoupled architecture. The system treats the Route (the URL), the Content (the raw data from Entries), and the Template (the visual rendering) separately.

Page acts primarily as a shell that defines the URL and the design, while the actual content is injected dynamically.

The Creation Workflow

The process follows four key steps to go from an idea to a published page:

1. Route Assignment

Every page is linked to a unique route_handle. This approach guarantees that your URLs remain stable and your internal links never break, even if you decide to change the page's title or slug later.

2. Editing Mode Selection

Pragma CMS defines three distinct editing modes, each corresponding to a different content architecture:

  1. Static Pages

    Content is edited via a single, traditional WYSIWYG field (Summernote). The layout is controlled entirely by a base template.

    When to use:
     Simple text pages that rarely change their structure (Legal Notices, Terms of Service, Privacy Policy).
  2. Dynamic Pages

    Content is strictly structured using Custom Fields (A "Content Type" acting as a Single entry). The layout is handled by a dedicated template designed to map exactly to these fields.

    That’s the most powerful mode. The page becomes a framework that pulls data from a specific Content.

    When to use:
     Highly structured content requiring absolute design consistency (Blog posts, News, Real Estate Listings, Products).
  3. Builder Pages

    Content and layout are created simultaneously by editors using modular Content Blocks (Powered by Editor.js). The frontend parses the resulting JSON into dynamic HTML elements.

    When to use:
     High-value marketing pages, landing pages, or unique designs that do not fit a rigid template.

    Works with the EditorJS editor.

Advanced: Extending the Page Builder

If you chose to build a Builder Page, your editors will use Editor.js. Pragma CMS allows developers to easily inject custom block tools using JS and PHP Hooks. Please refer to the Reference: Hooks & Extensibility - Pages.  

Note on System Archives

You do not need to create a "Page" shell for Taxonomies or Terms. These are handled natively by the core engine to prevent slug collisions. If you need to edit the SEO or the introductory text for a category list, navigate to Content > Taxonomies instead of the Pages menu.

3. Automatic Resolution (The Bridge)

This is where the "Shell/Content" architecture shines. The universal page controller analyzes the chosen mode:

  • If the page is Static or Builder, it fetches the data directly using the page_id.
  • If the page is Dynamic, it automatically builds a bridge to the Entries system. It resolves the corresponding Entry ID to inject the structured custom fields directly into $page->entry['fields'].

4. Template Selection

Finally, the user selects the view file (.php or .twig) from those available in their theme or extensions. Pragma CMS handles the final step: injecting SEO data, author metadata, and the processed content (HTML or JSON) into the chosen template.