TYPO3 CMS Extension asset expor integration for Pattern Lab Fluid Edition
Package which hooks into the Pattern Lab Fluid Edition to write your patterns as proper TYPO3 CMS Fluid template files into an extension folder - which then is more or less plug and play., (*1)
Adding this package to a Pattern Lab Fluid Edition means that when you generate templates (either by watching files or
manually generating) your files get copied and adjusted so they fit into a TYPO3 CMS extension's Resources
folder., (*2)
The following rules are in place:, (*3)
Resources/Private/Partials/Atoms
that you can easily render from any of your templates.Resources/Private/Partials/Molecules
- and are also partials.Resources/Private/Partials/Organisms
- and are also partials.Resources/Private/Templates/Default
- which emulates a "DefaultController" to scope templates.Resources/Private/Templates/Page
- which emulates a "PageController" to scope templates.Layouts are handled specially and separately. If any of your Templates
or Pages
use a Fluid layout, then this is
also extracted, rewritten and copied to Resources/Private/Layouts/
., (*4)
Note here that while Pattern Lab allows you to use a Layout for every pattern down to the Atoms type, the Layout is only
respected in TYPO3 CMS for the Templates
and Pages
types. Though they do get copied, they still contain the Layout
reference, and most likely only can be rendered by rendering a specific section. This means that in order to render
an Atom, Molecule or Organism which in Pattern Lab uses a Layout, in almost all cases you will have to call f:render
with both a section
AND partial
argument!. This package does not correct the render statements in this case;
though that may be added as a feature at a later time., (*5)
Once installed, your Pattern Lab Fluid Edition's config/config.yml
file can be edited to add:, (*6)
fluidTYPO3ExtensionExportPath: /path/to/my_extension
Define the target path pointing to the root of the extension folder. The rest, e.g. Resources/Private
, is implied., (*7)
Attempting to generate your templates without this parameter present will trigger an exception asking you to add the configuration option., (*8)
Once your templates are exported, how you render them will depend largely on your preferred integration method (either
as controller action templates, as FLUIDTEMPLATE
objects or other) but there are a couple of hints to achieve the
most transparent integration:, (*9)
Fluid Styled
Content
allows you to override templates using TypoScript. You can use this to your advantage, by letting Pattern
Lab generate core content type templates for example as the Template
pattern type.plio
namespace name.This work was kindly sponsored by Busy Noggin., (*10)