[SOLVED] Change form-layout and path to fusion-template

Hi,
would like to change the layout from a form – In particular from fields. I Read the code like in docu recommended and also found the line 287 in «adjust-form-output.rst» in Typ3.Form/Dokumentation.

But “Copy the layout file to Your.Package/Private/Resources/CustomElements/Layouts/Field.html and …” seams to be obsolete or false. Maybe it is only a “word-twister”.
Maybe it should be written there: Your.Package/Resources/Private/CustomElements/Layouts/Field.html?

I tried it with this path: fusion-template in directory «Layouts» in «CustomElements» in «Private». But doesn’t work. So maybe it is obsolete?

Hope there is also a more recent/different approach with a fusion/typoScript2 script possibility to define the templatePath? Or does it have to stay under CustomElements/Layouts/…, because the formRenderer always is searching under CutstomElements/Layouts ?
Would be easier to define an own more self-explanatory path like «Resources/Private/Templates/Form/Field.html»

###Question

  • s it possible to change the form-template path in fusion or somewhere else (yaml)?

Hello Martin,

did you find this here https://flow-form-framework.readthedocs.io/en/stable/adjusting-form-output.html#creating-a-custom-preset

You basically create a custom form preset based on the default one. In there you can alter the fluid template used to render each item or you add compete new item-types as described in https://flow-form-framework.readthedocs.io/en/stable/adjusting-form-output.html#adjusting-a-form-element-template

The last thing is to make the neos form-plugin use this custom-preset.

prototype(TYPO3.Neos.NodeTypes:Form) {
	presetName = 'myCustomPreset'
}

Regards, Martin

Perfect thank you @martoro!
At first, documentation has ripped me. Is currently a bit tricky with name-convention-changing (I guess): TYPO3 -> NEOS! So, for other Seeker:
I was looking for delete the «.clearfix«-class and change layout and structure of form with change the path to own fusion-template for form-part «Field».

##WORKING SOLUTION:

1. CREATE NEW OR COPY FUSION-TEMPLATE IN YOUR DIRECTORY:
E.G:
FROM : /Packages/Application/TYPO3.Form/Resources/Private/Form/Layouts/Field.html
TO : /Packages/Sites/Vendor.Site/Resources/Private/CustomElements/Layouts/Field.html

2. SET YOUR OWN PRESET WITH MATCHING PATH:


#Vendor.Site/Configuration/Settings.yaml

TYPO3:  
  Form:
    yamlPersistenceManager:
      savePath: 'resource://Vendor.Site/Private/Form/'
    presets:
      ########### CUSTOM PRESETS ###########
      preset1:
        title: 'Preset 1'
        parentPreset: 'default'
        formElementTypes:
          ### override default layout path ###
          'TYPO3.Form:Base':
            renderingOptions:
              layoutPathPattern: 'resource://Vendor.Site/Private/CustomElements/Layouts/{@type}.html'

* I guess: Because of change the name-convention from «TYPO3 -> NEOS» the documentation is currently quite tricky, because there is (at 02.01.2017 v:stable) «NEOS.Form:Base» written in Documentation and also in other places. This does not worked for me with latest Neos-version 2.3.x and threw no errors (I guess the documentation has allready changed for Neos 3.0 with «NEOS»-name Convention).

3. USE «TYPO3.Form:Base» IF NEOS-CMS < 3.0 OR «NEOS.Form:Base» IF NEOS-CMS >= 3.0

4. PROVIDE «preset» IN presetName WITHIN TYPO3.Neos.NodeTypes:Form

#/Packages/Sites/Vendor.Site/Resources/Private/TypoScript/Root.ts2
#OR particular nodeType-File like: /Packages/Sites/Vendor.Site/Resources/Private/TypoScript/NodeTypes/Form.ts2

prototype(TYPO3.Neos.NodeTypes:Form) {
    presetName = 'preset1'
}
1 Like