A declarative approach to website developement


This page is not yet fully completed - we are still working on the content here. Expect some rough edges 🙃

Why Fusion?

Fusion is the central data transformation engine for Neos. It enables you to create a variety of formats (like HTML, AMP HTML, RSS, JSON...) from the same contents. To make this happen Fusion fetches data, transforms it and sends the output to the client. That's Fusion's core business.

Fusion is declarative. You don't tell Fusion how to do something but order it do make it happen. We've included several standard functions like string concatenation. Those are used in pretty much every website and you don't need to implement those over and over again. You may be building a big site without one line of PHP code.

Martins comment: Beeing declarative in nature fusion allows to describe the expected result instead of implementing algorithms like classic php. Since the transformations in websites are very similar and often end up rendering some html-code Fusion comes with lots of prototypes that help creating websites. Having most of the standard transformations covered by Fusion, Neos projects often contain little to no php-code.

Another way to put it: You define (complex) behavior with Fusion. You could create a set of components, reuse them and make adjustments. Taming special snowflake nodes (e.g. displaying a headline in red on Christmas) is easy. Bonus: Those modifications to the output are separate from the content. Showing the same content in different contexts and formats is a key feature.

You could achieve the same thing using plain PHP. In that case, however, you need to take special care to have meaningful code structure and separation. Fusion forces you in a friendly way to do it right.

Fusion never forces you to say no to your client or boss. Everything can be overwritten and customized to your wishes. Although Fusion equips you with a lot of power you can dig in deeper with custom PHP classes and extensions.

The Language

// String assignment
name = "Earth"

// Nested object = "Earth"               // String
planet.population = 8000000000      // Integer
planet.dead = false                 // Boolean
planet.areafiftyone = null          // Null
planet.plancktime = 5.39116         // Floating point

// Nesting without repeating the key (or lazy programmer style)
planet {
  name = "Earth"
  population = 8000000000
  dead = false
  areafiftyone = null
  plancktime = 5.39116

Fusion has many similarities to existing languages and borrows good concepts. The three ingredients are literals, expressions and objects. There is no equivalent to typical arrays.

  1. What's Fusion? A configuration language? When does it output something? Why is there no return of the function?
  2. What's possible with Fusion? Where are the limits?

Objects & Your Data

The language itself is built around objects that perform the action. Objects could be pages, buttons, sections, contacts ... Now you need to tell Neos how to handle and render an object. Let's have a look how this works:

An object has attributes and a context. Attributes help you to define the behavior of your object. The context gives you insight on the surroundings of your object.

The context answers questions like: Which node am I processing? Which is the closest document node? What HTTP request parameters are set? Those answers change depending on the node your object is working on.

The Content Repository supplies the context. You bring those in and map the relevant context variables to object attributes. This makes them available in your templates.

  1. What are object and how are they declared?
  2. How to assign values to variables.
  3. What data types are there?
  4. How to nest objects?
  5. Representing Fusion objects in JSON? How would they look like?

Prototypes & Inheritance

  1. What's that prototype(...) syntax?
  2. How do inherit stuff?
  3. Why is it called prototype?

Everything you do with Fusion is side-effect-free. You are only working on a specific part of the content tree. Now it is easy to render or cache a specific part of a page.






  1. What's cached?
  2. How is the cache busted?
  3. When do you need to adjust the caching directives?


  1. What debugging options and methods do we have?
  2. How can I test my component in isolation? (Do we want to mention Monocle)?