LogoLogo
  • Introduction
  • Early Access
  • System Requirements
  • Elements FAQ
  • Purchasing & Licensing FAQ
    • License Types
  • Why Elements?
    • Static Website Benefits
    • Build a Digital Garden
  • Community Forum
  • Marketplace
  • Elements App
    • Getting Started
    • Keyboard Shortcuts
    • Migrations
      • Migrating from Blocs
      • Migrating from Classic
      • Migrating from Stacks
    • Design System
    • Editor
      • Apple Intelligence
      • Component Inspector
      • Dark Mode
      • Node Browser
      • Page Manager
      • Preview
      • Resources
      • Responsive Breakpoints
      • Workspaces
    • Components
      • Built-in Components
        • Accordion
        • Background
        • CMS
          • Helpers
          • Developing for the CMS
            • ElementsCMS.php
            • ElementsCMSCollection
            • ElementsCMSItem.php
          • Frontmatter
          • Markdown
          • Online Editor
          • Pretty URLs
          • Template Data
        • Button
        • Container
        • Divider
        • Dropdown
        • Flex
        • Filter
        • Filter Tags
        • Form
        • Gallery
        • Grid
        • Image
        • Menu
        • Modal
        • Modal Close
        • Reveal
        • Image Slider
        • SVG
        • Text
        • Top Pages
        • Typography
        • Video
      • Common Controls
        • Link
        • Layout
        • Sizing
        • Spacing
        • Transitions
        • Effects
        • Filters
        • Transforms
        • Borders
        • Advanced
      • Custom Components
    • Globals
    • Templates
    • Project Settings
      • General
      • Web Icons
      • Advanced
      • Template
      • Publishing
        • How to fix Publishing Issues
    • Theme Studio
      • Theme
      • Screens
      • Page
      • Colors
      • Font Family
      • Font Size
      • Spacing
      • Shadows
      • Border Width
      • Border Radius
      • Typography
    • How to
      • Add an Icon Inside a Button
      • Adjust Smooth Scroll Speed
      • Apply Anchor Scroll Padding
      • Add Snow to your Website
      • Build a Sticky Menu
      • Center Align Components
      • Create a Card
      • Site Banner with Text
      • Make a two column layout
    • Resources
    • Troubleshooting
    • SEO
      • Robots.txt
    • Accessibility
    • Advanced
      • URL Scheme
  • Elements Language
    • Introduction
      • Getting Started
      • Component Styling
    • Element Pack
      • info.json
      • Components
        • info.json
        • Icons
        • Properties.json
          • Grouping Controls
          • Default Values
          • General Structure
            • Title
            • ID
            • Format
            • Visible
            • Enabled
            • Responsive
          • UI Controls
            • Divider
            • Heading
            • Image
            • Information
            • Link
            • Number
            • Resource
            • Segmented
            • Select
            • Slider
            • Switch
            • Text
            • Text Area
            • Theme Border Width
            • Theme Border Radius
            • Theme Color
            • Theme Font
            • Theme Spacing
            • Theme Shadow
            • Theme Text Style
            • Theme Typography
        • HTML Templates
          • Portal
          • Backend
          • Conditional Statements
          • Regular Expressions
          • Looping
          • Includes
          • Image Resources
          • HTML
            • Anchor
            • Raw
            • Editable Content
            • Dropzones
            • Inline templates
          • CSS
          • JavaScript
        • Assets
        • Hooks.js
          • Common use cases
          • Passing data to templates
          • Working with Collections
          • Working with UI Controls
          • Working with Resources
          • Available Functions
            • rw.addAnchor
            • rw.getBreakpoints
            • rw.getBreakpointNames
            • rw.getResponsiveValues
            • rw.resizeResource
            • rw.setProps
            • rw.setRootElement
          • Available Data
            • rw.collections
            • rw.component
            • rw.node
            • rw.pages
            • rw.project
            • rw.props
        • Shared Files
          • Assets
          • Templates
        • Collections
          • Data collections in Hooks.js
          • Accessing Data in Templates
          • Collections in properties.json
      • Resources
      • Templates
      • Themes
    • Troubleshooting
  • Elements Cloud
    • Getting Started
    • Troubleshooting
  • Elements Marketplace
    • Getting Started
    • Add-on Guidelines
    • Marketplace API
  • Branding
    • Logotype
    • Logotype Animated
    • Icon
  • Legal
    • Subscription Terms of Service
    • Cloud Terms of Service
    • Frameworks
Powered by GitBook

We are Realmac Software. We make nice things.

On this page
  • Server Requirements
  • File and Folder Setup
  • Content
  • Authors
  • RSS Feed
  • Advanced

Was this helpful?

Edit on GitHub
Export as PDF
  1. Elements App
  2. Components
  3. Built-in Components

CMS

Markdown based Content Management System in Elements

Server Requirements

The CMS Components in Elements require PHP 8.x or newer. You must ensure all CMS related pages use a .php extension.

Wrapper Components

These components are used as wrappers, or container, components. You should place other components inside of these. Components placed inside these components will gain access to CMS data.

CMS Component
Description

Static Item

Wrapper for fetching a single item from the CMS.

Collection

Wrapper for fetching a collection (folder) og items.

Collection Item

Used for Collection page templates. Will fetch the requested Collection Item based on the slug in the URL.

Collection Search

Adds instant search for any collection.

Child Components

These components should be placed inside the wrapper components. These components have access to CMS data, such as as the title, date, author, body, and so on.

Component
Description

Body

Used to access the body of an item.

Item Author

Display the author for the current item.

Item Tags

Display tags for the current item.

Related Items

Display items related to the current item. Must be placed inside a Static Item or Collection Item.

Collection Pagination

Adds pagination links to any collection. Must be placed inside a Collection.

Conditional

Conditionally display content.

File and Folder Setup

The built-in CMS system in Element requires a specific file and folder setup to work. You must ensure all blog related pages use a .php extension.

Content

Content should be stored as Markdown down files inside a dedicated folder.

  • cms

    • posts

      • 2025-04-18-my-first-post.md

      • 2025-04-19-another-blog-post.md

The structure for the Markdown file:

---
title: "An Example Post"
date_published: "2025-04-20"
author: Steve
tags: [technology]
status: published
feature_image: blog/myimage.jpg
featured: true
---
This is the contents of my first post.

Authors

You can create additional metadata about Authors by organizing a folder structure with supplementary markdown files. In this example, the authors folder is placed at the same level as the "posts" folder.

  • cms

    • posts

    • authors

      • steve.md

      • jasmin.md

The structure for the Authors Markdown file:

---
name: "Steve"
avatar: blog/steve-photo.png
---
This is all about Steve.

RSS Feed

Any page with a CMS collection can provide an RSS feed. Simply append ?format=rss to the end of the URL, like this yourwebsite.com/blog/?format=rss .

Advanced

A $post array containing the post's information is available to any component placed inside a Collection or Item component.

Name
Type
Example

author

array

<?=$post['author']?>

author.avatar

string | null

<?=$post['author']['avatar']?>

author.bio

string | null

<?=$post['author']['bio']?>

author.name

string

<?=$post['author']['name']?>

author.slug

string

<?=$post['author']['slug']?>

body

string

<?=$post['body']?>

date_published

string

<?=$post['date_published']?>

featured

boolean

<?=$post['featured']?>

feature_image

string

<?=$post['feature_image']?>

slug

string

<?=$post['slug']?>

status

string

<?=$post['status']?>

tags

array

<?=$post['tags']?>

title

string

<?=$post['title']?>

PreviousBackgroundNextHelpers

Last updated 6 days ago

Was this helpful?