19/02 2012
Fluid tag auto-completion and validation

Want automatic tag argument insights, validation and immediate info about argument types? UPDATE: screen cast now included!

Dear developers,

Today brings excellent news. Especially if you already use an XSD-capable editor for your projects. Using the newly backported Fluid ViewHelper XSD Generator I have created XSD schemas for all FED and Flux - and Fluid - ViewHelpers. If you download these XSD files and include them in your editor, you get automatic tag completion and argument validation.

Here is how:

First, download the files you need. These are:

  • The Fluid ViewHelper XSD
  • The FED ViewHelper XSD
  • The  Flux ViewHelper XSD

 

Note that these are saved using the same filename (ViewHelpers.xsd) to reflect the proper namespace in the URLs. You may want to rename or place the files in corresponding subfolders.

Second, register the XSD schemas in your editor with the appropriate namespaces:

Fluid ViewHelpers: namespace http://typo3.org/ns/fluid/ViewHelpers

FED ViewHelpers: namespace http://fedext.net/ns/fed/ViewHelpers

Flux ViewHelpers: namespace http://fedext.net/ns/flux/ViewHelpers

Lastly you now need to make your editor aware that these namespaces are used (and make the connection between VH namespace and XSD namespace - which means you can also register other names than, for example, "fed" for FED's ViewHelpers as long as you remember this in the mapping:

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"
    xmlns:flux="http://fedext.net/ns/flux/ViewHelpers"
    xmlns:fed="http://fedext.net/ns/fed/ViewHelpers"
    xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">

<f:section name="MySection">...</f:section>

</html>

Assuming you setup your editor correctly you will now be able to do validation of all arguments you use with FED, Flux and Fluid ViewHelpers. For example, your editor will now warn you about missing required arguments and make auto-completion lists when adding arguments.

UPDATE: I added a screen cast showing off how to both include XSD files and generate your own schemas for your own ViewHelper collections. Watch the video here.

Happy Fluiding :)