Craft CMS Fundamentals
Introduction to Craft CMS
What is Craft CMS?
A content management system, or CMS, is a tool that helps you create, manage, and modify content on a website without needing to be a programmer. Think of it as the backstage area of a theater, where you arrange the props and scenes before the audience sees the play.
Craft CMS is a specific type of CMS known for its flexibility and focus on custom content. While some platforms give you a pre-built house and let you repaint the walls, Craft gives you a plot of land and a box of high-quality building materials. You get to decide exactly what you want to build, from a simple blog to a complex e-commerce site.
Its main purpose is to give developers and content creators complete control. Instead of forcing your content into predefined boxes like "posts" and "pages," Craft lets you define your own content structures. This approach results in a cleaner, more intuitive editing experience tailored specifically to your project's needs.
Core Features
Craft's power comes from a few key concepts that set it apart.
Custom Fields are the fundamental building blocks. You can create fields for anything: plain text, dates, colors, images, or even relationships to other content.
Matrix Blocks take this a step further. A Matrix field is a container for a flexible set of other fields. Imagine creating a webpage where the editor can add and reorder different content blocks—a text block, an image gallery, a pull quote, a video embed—in any order they want. That's what Matrix enables. It gives content editors incredible freedom without breaking the site's design.
Finally, Craft uses a templating language called Twig. This engine keeps your content completely separate from your design. Your data lives in Craft, and your Twig templates pull that data into your HTML. This separation makes the website easier to maintain and redesign in the future.
Craft vs Other Platforms
The CMS world is crowded, with WordPress being the most well-known player. The key difference between Craft and platforms like WordPress or Drupal lies in their philosophy.
| Feature | WordPress | Craft CMS |
|---|---|---|
| Content Model | Primarily Posts & Pages | Completely custom (a blank slate) |
| Plugins | Thousands available, quality varies | Fewer, but generally high quality |
| Flexibility | Good, but often requires overriding default behavior | Excellent, designed for custom solutions from the start |
| Target User | Bloggers, small businesses, beginners | Developers, agencies, content strategists |
WordPress is opinionated. It assumes you're building a blog or a standard site and gives you a structure based on that assumption. This makes it fast to get started, but it can become cumbersome when you try to build something it wasn't designed for.
Craft is un-opinionated. It makes no assumptions about your content. This means more setup work upfront, but the final result is a system that perfectly matches your project's requirements, with no unnecessary clutter.
A Glimpse at the Architecture
Under the hood, Craft is built on a modern PHP framework called Yii. You don't need to know Yii to use Craft, but this foundation provides security, stability, and speed. The architecture is designed to be modular and clean.
At its heart are three main components:
- The Core System: This is the engine, built on PHP, that handles all the logic, from user authentication to database queries.
- The Database: This is where all your custom fields and content are stored in a structured way.
- The Templates: These are the Twig files that define how your website looks. They request content from the database and display it as HTML.
This clear separation makes Craft a powerful and maintainable choice for projects that demand a custom-tailored content experience.
What is the primary philosophical difference between Craft CMS and a platform like WordPress?
Which Craft CMS feature allows content editors to build pages using a flexible set of reorderable content blocks (e.g., text, images, videos)?