Understanding Sulu and taking your first steps

This guide will help you understand whether Sulu is for you, and give a look at the road ahead if you choose it. Every CMS has its own “grain” and its best to work with it not against it. While we designed Sulu to be as flexible as possible, especially for developers, understanding Sulu’s grain will help you choose the right CMS for your needs, avoid frustration, and deliver better developer, editor, and end-user experiences.

Development is best left to developers

Having a developer install bundles with Composer is how you extend Sulu. In other CMSs, you can use the browser interface to add plugins or extensions, and configure the website. In Sulu, users cannot upload code through the browser, which improves security. In general, we leave all work that involves adding or changing code to developers.

Configuration belongs in code, not the database

Sulu puts most configuration options in code, so only developers can change them. Editors get a slick day-to-day editing experience, but for big structural changes — such as adding new features and changing the design — they need to consult a developer.

This means developers can track changes using a version-control system such as Git. In this case, we think Sulu works with the grain of a developer’s ideal workflow.

Symfony developers can get started right away

Sulu is built in Symfony, a highly flexible and powerful PHP framework, and many developers already work with it. But building your own content management system in Symfony is very complex — we should know! — because there are many details to attend to. These include multilingual functionality, caching, templating, and much more. If you’re a Symfony developer, you probably don’t want to build, test, debug, and maintain all this yourself. Why reinvent the wheel? By building on top of Symfony instead of establishing its own coding standards and conventions, Sulu works with the grain of many developers.

Open source makes developers’ lives easier

A great developer experience means as few hurdles as possible. With Sulu, you can get the Sulu code with a Composer command and you’re free to use it as you like with no license fees or per-seat subscriptions.

Reuse what you can, and extend where necessary

Sulu gives you the best of both worlds. You can write all your own business logic and custom data objects in your Symfony project as usual, and just use Sulu alongside it as a provider of content management features. Sulu itself is a reflection of this philosophy: we build on top of  Symfony to save ourselves the effort of creating things that already exist. We’ve made everything that we build reusable so you can do the same.

Great editor experience is key, not only for content projects

For all the talk of developer experience, Sulu’s admin interface is one of its best selling points. While we pitch Sulu mostly as a CMS, you can reuse and extend the admin interface for non-content business logic and data objects, too. For many use cases, it’s a question of simply configuring backend templates with XML files. React developers can extend and build more advanced functionality if necessary. Check out our guide to find out more. Because of our unique approach to content — we deal with it as another form of data — this is possible.

Sulu loves structured content

Blocks are fundamental to Sulu. They are pre-defined collections of content types that an editor can add to a page or other entity. They give the editor freedom to add and rearrange chunks of content while entering it in a structured form. This also ensures that design is consistent across the site, and is reusable long into the future regardless of device or presentation. Find out more in the Blocks or Structured Content guide.

As described in the guides, this approach is ideal for designers who adhere to atomic design principles because elements that are reused across the site are highly standardized. If you’re used to WYSIWYG editors, or purely template-based approaches, you can theoretically work like this in Sulu but you’d be working against the grain and not taking advantage of the full power of Sulu.

Freedom for frontend developers

When you first install Sulu, the user-facing website is almost blank. You might be expecting a default theme, but we don’t include one. This is because there isn’t really a “proper” way to write a theme in Sulu: the beauty is that you’re free to use Twig to build the frontend however you want. For this, you can consult resources on frontend development with Twig.

For Twig developers, it should be quite straightforward to get up-and-running. The benefit of this is having very few restrictions: as long as you use Twig as your templating language, you can always work with the latest version of whatever frontend technology you choose.

Deciding whether to adopt Sulu as an agency

Before moving to Sulu, there are a couple of questions you might like to ask yourself to find out whether Sulu is the right choice for your needs.

Does my agency deliver high-performance, complex projects? Sulu is for projects that have to stand up to high levels of traffic, even when they contain complex business logic. It’s designed to be scalable, so you can host it in the cloud, scale with Kubernetes clusters, cache with Varnish, bring content closer to customers with CDNs, and much more. If your clients require relatively standardized, low-traffic sites that can be delivered with existing solutions, then you may be better off sticking to your tried-and-tested tools.

Do I face challenges delivering client needs? If you have feature requests that you have difficulty delivering with existing tools, Sulu is probably worth a look. Standardized CMS and blogging tools are great for their intended field, but developers can run into problems when extending them for bespoke features.

Is deployment, testing, and CI/CD an issue for my team? Sulu avoids configuration in the database at all costs, and it’s built on Symfony so you get unit-testing built in.

Do my developers know Symfony or are they able to learn it? If you have Symfony developers in your team, then you really need to think about using Sulu. If not, your professional developers might be happy to use Sulu as an excuse for learning Symfony because it’s a powerful, well documented framework that they can use for many projects. Alternatively, you can recruit Symfony developers.

Do I have the infrastructure to support large-scale websites? While a basic Sulu setup is relatively easy to install, Sulu comes into its own when running at scale and at speed. To leverage its full potential, you need to have staff who can install and maintain ambitious infrastructure setups to optimize performance. Things like Elasticsearch, Redis, Kubernetes, Varnish, and so on. Using Sulu for a medium-sized blog is like Mariah Carey doing karaoke : it’s possible, it can be fun for a while, but Sulu thrives on big audiences and prime-time performances.
 

Benefits for agencies

  • Recruit from a large pool of Symfony and Twig developers, who will be able to get started on Sulu projects quickly.
  • Clean code base, more security, easier maintainability.
  • Websites deliver value for longer when mindfully maintained.
  • Editors can focus on their jobs using the slick admin interface, while staying on-brand.
  • Promotes atomic design principles and thought-through information architecture.

We’re here to help you get it right

Do you need help planning your project? Get in touch and we can fast-track you to success with our workshops as well as consulting and coding services.

Help

Developing your first Sulu website

If you’re a Symfony PHP developer, you’ve already got a headstart and should find it easier to navigate through the source code. Sulu has a compact core with no more features than necessary. If you want something that isn’t in core, you can check out the official Sulu bundles, search the Symfony ecosystem for a bundle, or build your own code. While standard plugins in other systems are great, they can quickly reach their limits and conflict with one another — at some point, you’re better off writing your own within Symfony’s standardized framework.

You can find a quick-start guide for setting up a development environment in the docs.

The requirements for a basic setup are:

  • PHP (minimum version 7.2)
  • Webserver, such as Apache. For development purposes, we recommend the Symfony local web server
  • Composer to get the code and manage dependencies
  • A database backend supported by Doctrine DBAL (e.g. MySQL or PostgreSQL)

The basic steps are:

  • Get the code with Composer and start tracking it with Git.
  • Configure a webspace using the example config file.
  • Set up and initialize the database.
  • Run a CLI command.
  • Start your local webserver and explore Sulu.

Sulu is well equipped to interface with external services for high performance. So although the initial development setup is relatively straightforward, specialist development skills may be required for high-traffic sites.

Next steps you might want to try out are:

“Gotchas” and “good-to-knows” before setting out

So you’ve decided to give Sulu a try. Here are a few things to watch out for to save you time.

Content types != content types

Sulu newcomers might expect the term “content type” to refer to pages, articles, and other content-rich entities. However, in Sulu-land, an entity, such as a page or article, can contain a range of content types — they are essentially the fields in the form an editor fills out while administering content. You can find a list of standard content types in the docs.

Where’s my Webspace?

Webspaces are powerful because you can have as many of them as you need, with each one containing the content for a different website. By setting permissions appropriately, you can give different editors access to content on different websites with a single Sulu installation. They’re ideal for multi-brand setups where you want to manage several websites from a single codebase.

When first setting up your project you need to enable at least one webspace to hold your content. The docs explain how to do this. Make sure you activate the webspace in the admin interface by enabling the appropriate user roles to view it, add content and so on. For security purposes, no-one has permissions to work with a webspace by default.

How do I add articles? Do I need Elasticsearch?

The basic Sulu install requires just a webserver, PHP, and a database. If you want to add thousands of articles for a news or blog site, we recommend to add the ArticleBundle. Many users of Sulu are publishers who need high-performance content, which is what Elasticsearch can deliver. The advantage of using the ArticleBundle is that you can arrange content in a flat structure and manage a much greater number of articles.

Get familiar with the sulu.rocks demo website

We’ve set up a working demo of Sulu over at sulu.rocks. You can play around with the backend here and see for yourself what a basic Sulu website (with the ArticleBundle installed) can do. Developers can dig into the code, which is hosted on Github, or download it and install it on their own development server to kick the tires and put it through its paces. It’s also a great opportunity for budding Symfony developers to learn how a Symfony project is put together.

Have fun with Sulu and get in touch if you need help

We hope you love Sulu and it gets you where you want to be as an agency, editor, or developer. The community is very supportive, and you can join us in Slack.

If you need a fast start, or require upskilling so that you can deliver more value to your clients, find out about our professional services.

Last Updated 30. June 2021

You might also be interested in these articles

Blocks

Structured Content with Blocks

In this guide we explain what Blocks are for and…
Learn more
Templating

Templating and structured content the Sulu way

Get an overview of the templating process in Sulu…
Learn more