Series 5

Sulu for developers

Structure, templates and operation in code

Development16 chapters
As of Sulu 3.0

How Sulu 3 fits together in code: templates, blocks, content by message, admin, tests and operation.

This series is for anyone who sets up or extends a Sulu 3 project. Each chapter explains one topic in code and backs it up with files from the website bertrams-media or from vendor/sulu/sulu in version 3.0.11.

The website bertrams-media is an example project. Its classes, commands and Twig functions, and bundles such as AdminExtras, are examples, not Sulu standard. The text says each time what comes from Sulu and what from the project. If a chapter needs an official Sulu extension, this is stated at the top of the chapter.

Where the official documentation explains a topic well, the chapter summarizes it briefly and links to it at the end. Where the user interface is meant, the chapters point to the series “Managing content in detail” and “Setting up and managing Sulu”.

All chapters of this series

Structure and templates

  1. Sulu 3 at a glance What Sulu 3 consists of and where your code comes in: Symfony, content packages, Doctrine instead of PHPCR and messages.
  2. Setting up a project and the webspace From an empty directory to the first login, and what the webspace file defines.
  3. Page templates: XML and Twig How a page template consists of an XML file and a Twig file, and which data Twig receives.
  4. Blocks, global blocks, includes and atoms How block lists, global blocks, XInclude files and reusable fields work together.
  5. Articles in Sulu 3 How articles are organized in groups and templates, how their address hangs on a page and what a new group needs.
  6. Snippets and snippet areas How snippets are created as a template, how an area assigns them to a webspace and how Twig loads them.

Content, admin and search

  1. Smart Content and custom filters How the field smart_content builds lists from pages, articles and other content, and how a custom filter is added.
  2. Writing content in code How to change pages and articles through messages, set single fields safely and avoid duplicate draft rows.
  3. Extending the admin How an admin class changes menus and views, how a toolbar action is created and how the admin is rebuilt.
  4. Custom field types A new field type needs a React component in the admin and usually a property resolver for the website.
  5. Search in Sulu 3 (SEAL) How Sulu 3 indexes and searches with SEAL, how you get fields and extra data into the index and where the limits are.

Output, operation and migration

  1. SEO and schema.org in Twig How the meta data from the tab SEO ends up in the head of the page and how pages and articles build a schema.org graph together. Applies to: Template of the example website
  2. Tests for templates and Twig Which tests protect a Sulu website with many templates: scripts for architecture and Twig, PHPUnit for logic and the lints. Applies to: Template of the example website
  3. Deploying and updating How a Sulu 3 website gets onto a server with git pull, what to watch for and how the HTTP cache follows.
  4. Opening Sulu to AI assistants (MCP) How the SuluMcpBundle lets an AI assistant work with the permissions of a user, what the switches do and which traps wait when writing. Applies to: official Sulu extension “MCP bundle”
  5. From Sulu 2 to Sulu 3 The steps of the official upgrade guide in short form and the stumbling blocks we hit when moving bertrams-media.