NamelessCoder / patternlab-fluid-edition

Pattern Lab Fluid Edition
MIT License
19 stars 2 forks source link

fluid elements themself does not get rendered #7

Open rob-ot-dot-be opened 4 years ago

rob-ot-dot-be commented 4 years ago

I adjusted a molecule and added f.image and a f.form.button to do a test. these elements does not get rendered.
Did I miss something on installation ?

`

BUTTON : Send Mail IMAGE: `
NamelessCoder commented 4 years ago

Both f:image and f:form.* are specific to TYPO3 CMS and will not work in Fluid standalone - you would need to emulate these ViewHelpers, e.g. create an emulated f:image that outputs a plain <img> tag, and emulate <f:form.button> which outputs a simple <button> tag.

Since TYPO3 CMS ViewHelpers often require significant context such as TS and TYPO3 environment with constants etc. it is not possible to we PatternLab with a full TYPO3 context. Depending on which ViewHelpers you need to use you might need to emulate quite a few of the ViewHelpers.

Note also that many ViewHelpers aren't strictly necessary, e.g. <f:form.button> when used without a name does not modify the HMAC checksum and therefore can just as well be served with a raw <button> tag. And of course it is good practice to separate as much of your view logic as possible, from your repository etc. logic - meaning that if you design your templates to work with already processed variables, you have reduced necessity for ViewHelpers and can use static values in the model data JSON files instead.