-1

I tried to edit the core file form\Resources\Private\Frontend\Partials\Field\Field.html to change the html output in the frontend. If I change that file, it has not effetcs. If I change the core file form\Resources\Private\Frontend\Partials\Textarea.html it effects the output in the frontend.

I've tried to set a custom partial, layout and templates folder like this: I've set the following in the setup part of the page template:

plugin.tx_form {
settings {
    yamlConfigurations {
        # register your own additional configuration
        # choose a number higher than 30 (below is reserved)
        100 = fileadmin/my_site_package/Configuration/Form/CustomFormSetup.yaml
    }
}
}

In fileadmin/my_site_package/Configuration/Form/CustomFormSetup.yaml I have

TYPO3:
CMS:
Form:
  prototypes:
    standard:
      formElementsDefinition:
        Form:
          renderingOptions:
            templateRootPaths:
              20:'fileadmin/my_site_package/Resources/Private/Templates/Form/Frontend/'
            partialRootPaths:
              20: 'fileadmin/my_site_package/Resources/Private/Partials/Form/Frontend/'

In the folder fileadmin/my_site_package/Resources/Private/Partials/Form/Frontend/ I have the copied Multicheckbox.html and the other copied partial files from the form core folder. I have edited the Multicheckbox.html, but it has not effects to the frontend.

WhoKnows
  • 9
  • 4
  • Please describe which steps you took already and how your configuration looks like. With the information provided, it's not possible to give any advice. – Oliver Hader May 08 '21 at 13:19
  • You're not editing core files??? For overriding templates, please have a look into the documentation: https://docs.typo3.org/c/typo3/cms-form/master/en-us/I/FAQ/Index.html#how-do-i-override-the-frontend-templates – Julian Hofmann May 08 '21 at 15:24

1 Answers1

0

Thank you so much for your input. The problem was because of the bootstrap package. There was a file Multicheckbox.html in the folder "typo3conf/ext/bootstrap_package/Resources/Private/Partials/Form". This one overrided the core file Multicheckbox.html

But what am I doing wrong in my steps? I'm getting now the following error in the frontend:

Oops, an error occurred! Tried resolving a template file for controller action "FormFrontend->form" in format ".html", but none of the paths contained the expected template file (FormFrontend/Form.html). No paths configured. More information regarding this error might be available online.

Did I set the paths in CustomFormSetup.yaml wrong? I've also tried

TYPO3:
CMS:
Form:
  prototypes:
    standard:
      formElementsDefinition:
        Form:
          renderingOptions:
            templateRootPaths:
              1:'/my_site_package/Resources/Private/Templates/Form/Frontend/'
            partialRootPaths:
              1:'/my_site_package/Resources/Private/Partials/Form/Frontend/'

with the same error.

WhoKnows
  • 9
  • 4
  • 1. Be aware of the cascade of configuration. `*Paths` should have multiple ordered entries. At least, there should be (with the lowest index) the fallback to the paths of EXT:form. 2. Not sure if it's wrong or something of your posts: beware of the indention in your YAML files. In both snippets, the indention of "CMS:" and "Form:" (and theirs children) is missing – Julian Hofmann May 09 '21 at 07:35
  • The wrong indention is only here, not in the file. – WhoKnows May 13 '21 at 09:40