Fluid syntax and xmlns namespaces

I didn’t dig very deep into the topic, but nevertheless I would like to start a discussion about the topic as it seems unresolved. Please don’t mind possible term incorrectnesses.

Neos 3.0 now integrates TYPO3/Fluid which is the standalone version of the templating engine. It’s supposed to be xml compliant, but there’s always the discussion on how to properly include ViewHelpers (custom and default ones).

{namespace foo=My\Custom\ViewHelpers}
<foo:some bar="baz" />
<f:if condition="1 == 1"></f:if>

Is heavily used, but doesn’t make your template file xml compliant and therefore not testable against XSD schema. The namespace f is not even recognized, because it’s the default namespace of the templating engine.

<html xmlns:f="https://neos.io" xmlns:foo="http://typo3.org/ns/My/Custom/ViewHelpers">
<f:section name="Content">
    <foo:some bar="baz" />

Is also used by some people.

All of the solutions have some implications. I personally would like to discuss about:

  • XML-valid fluid templates?
  • Testability (validate via XSD) on CI servers ?
  • Autocompletion in IDE (maybe auto download of XSD file if URL is correct and not manually include them as external XSD)
  • What should be the domain for the namespace? typo3.org, neos.io or depending on the package ?
1 Like

I’ve been playing around with the schemas quite a bit as I like the autocompletion help and validity helpers in PHPStorm when included correctly.

It’s a bit of a hassle to generate the schemas right now and IMO the functions for that need some improvement.

It would be great if we find some way to read the schemas from the packages we already collect from packagist and somehow serve them automatically from neos.io.
For example every maintainer could provide a hint to the schemas location in the repo in the composer.json.