April 30, 2013

Howto: Autocompletion for fluid in PhpStorm

Category: Extbase

By: Anja Leichsenring

Schema Setting in Phpstorm


As a TYPO3 extension developer, you might already use PhpStorm as your IDE, it gives you so many benefits in your PHP coding. You probably love the auto completion, syntax highlighting and keyboard shortcuts. One missing bit is that Storm by default does not understand the Fluid template engine syntax and paints lots of red marks to your code. But thankfully, the designers of Fluid made the template engine compatible to XML standards, so it is possible to enable PhpStorm understand the bits and pieces of this.

This howto is about getting PhpStorm understand and autocomplete your fluid code.

Thanks to the a schemagenerator by Claus Due (@NamelessCoder), there is an easy way. On his website you can download the xsd schema files for the TYPO3 system extension fluid, as well as for his own collection of extensions. As a bonus you can create the schema for your own viewhelpers.


  • Download the fluid xsd and store it locally.
  • Open the "Settings" dialog of PhpStorm. This is a project based setting, keep in mind to repeat this step for other projects.
  • Insert a new record into the Schema and DTD -> external schema section (refer to the attached image how this looks like).
  • Choose an uri according to your liking, it must be unique, and relate it with the xsd file. 
  • Save the changes and close the settings dialog.
  • Use "xmlns" tag in your layouts, templates and partials. Thats possible by using sections.

Example for a Template file (using a Layout that only contains the main section):

<div xmlns="" lang="en"
     xmlns:f="" >
<f:layout name="Default" />
<f:section name="main" >
 // your fluid code is here

Example for a Partial file:

<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="" lang="en"
 <title>Partials: ValidationResults</title>
<f:section name="Main">
  // your fluid code is here

Enjoy increased coding speed and decreased typos in your TYPO3 Fluid Views ;)


comment #1
Gravatar: Karsten Dambekalns Karsten Dambekalns May 4, 2013 22:10
If no project is open in PhpStorm, it is possible to set "Template Project Settings" that are used for any new project. Very useful to avoid repeating of setting this and other options.

Another way to ease making this setting for multiple projects is to export it once and import it into further projects - that saves a few clicks.

Sorry, comments are closed for this post.