« Previous | Next » 

Revision 432ebf65


Added by Bastian Waidelich over 9 years ago

[FEATURE] Declare namespaces in XML tag

This makes it possible to declare Fluid namespace identifiers with
the common xmlns syntax <html xmlns:foo="http://some/unique/namespace&quot;>
That works as a replacement for xml/html based Fluid templates which
can be used instead of the {namespace foo=Bar} syntax.

This syntax triggers auto-completion in most IDEs if the xml
namespace is bound to a valid XSD schema!


  • Create a XSD file for your ViewHelpers by executing
    ./flow3 documenation:generatexsd Your\\Package\\ViewHelpers
    --target-file some/directory/your.package.xsd
  • Add the namespace to your Fluid template by adding the "xmlns:"
    attribute to the root tag (usually <xml ...> or <html ...>).

If you want to use this inside partials, you can use the "section"
argument of the render ViewHelper in order to only render the content
of the partial:

<html xmlns:x="http://typo3.org/ns/Your/Package/ViewHelpers&quot;>
<f:section name="content">
<x:yourViewHelper />

<f:render partial="PartialName" section="content" />


You are able to use a different XML namespace pattern by specifying
the --xsd-namespace argument in the generatexsd command.

The default pattern "http://typo3.org/ns/&lt;php namespace>" is resolved
automatically by the Fluid parser. If you use a custom XML namespace,
you need to configure the namespace mapping.

The (YAML) syntax for that is:

'http://some/unique/namespace&#39;: 'My\Php\Namespace'

Change-Id: I4d184ee81677c59583bdc7f6f19375155b60efe8
Resolves: #27119
Releases: 1.1

  • added
  • modified
  • copied
  • renamed
  • deleted