UnpassableWizard
UnpassableWizard

Reputation: 1279

Typo3 form 9.5.11 how to add my own class to element?

I am using form (9.5.11) to make a relatively simple form, just needs a fieldset to be in the HTML structure with a custom class on it with value: col-sm-6 for Bootstrap.

This is a piece of the .yaml:

renderables:
  -
    type: Fieldset
    identifier: fieldset-1
    label: ''
    renderables:
      -
        defaultValue: ''
        type: Text
        identifier: text-1
        label: ''
        properties:
          fluidAdditionalAttributes:
            placeholder: 'First Name'
            required: required

How can i possibly add a class to the fieldset?

Thanks for pointing me in the right direction

Upvotes: 1

Views: 2731

Answers (1)

UnpassableWizard
UnpassableWizard

Reputation: 1279

The answer is:

properties:
  elementClassAttribute: 'col-sm-6'

On the fieldset:

renderables:
  -
    type: Fieldset
    identifier: fieldset-1
    label: ''
    properties:
      elementClassAttribute: 'col-sm-6'
    renderables:
      -
        defaultValue: ''
        type: Text
        identifier: text-1
        label: ''
        properties:
          fluidAdditionalAttributes:
            placeholder: 'First Name'
            required: required

Upvotes: 4

Related Questions