# HTML Renderer configuration

# Usage

# Example


<field_renderer>
  <type>html</type>

  <field_renderer_attributes>
    <entry key="allow_custom_elements" class="boolean">true</entry>

    <entry key="additional_allowed_tags" class="array">
      <value>style</value>
      <value>iframe</value>
    </entry>

    <entry key="additional_allowed_attributes" class="array">
      <value>custom_attribute</value>
    </entry>

    <entry key="editor_controls" class="array">
      <value class="array">
        <value>fontFamily</value>
        <value class="map">
          <entry key="options">allowedFonts</entry>
        </value>
      </value>
      <value>fontSize</value>
      <value>fontColor</value>
    </entry>

  </field_renderer_attributes>

  <field>
    <name>html_content</name>
    <type>CEText</type>
  </field>
</field_renderer>

# Field renderer attributes

# Editor configuration

The editor configurations defines only the behavior of the editing version of the renderer. No matter what you configure here, the result is configured in the view configuration.

  • editor_controls
    • type: array of controls
    • description: Here you define all the controls you want wo have in the editing version. If there is no editor_controls configuration, the default will be loaded. But if you configure something, the defaults are no longer be loaded. Each entry is a string or an array of string and configuration.
    • example:
      <entry key="editor_controls" class="array">
        <value class="array">
          <value>fontFamily</value>
          <value class="map">
            <entry key="options">allowedFonts</entry>
          </value>
        </value>
        <value>fontSize</value> 
        <value>fontColor</value> 
        <value>alignment</value> 
      </entry>
      

For all configuration possibilities, take a look here.

# View configuration

The view configurations defines only the behavior of the reading version of the renderer. No matter what you configure here, the input options are configured in the editor configuration.

  • allow_custom_elements
    • type: boolean
    • description: By default custom elements are not allowed. Turn it on if and only if you need it. Default false
  • additional_allowed_tags
    • type: string array
    • description: Sometimes you need some specific not allowed html tags for your special needs such as iframe or style. Be careful when using them, as they may result in potential security risks
    • example (allows style and iframe tags):
      <entry key="additional_allowed_tags" class="array">
        <value>style</value>
        <value>iframe</value>
      </entry>
      
  • additional_allowed_attributes
    • type: string array
    • description: There are many html attributes that are erased automatically. For some use cases (especially when using custom elements or tags like iframe) your need to define additional allowed html attributes. Be careful when using them, as they may result in potential security risks
    • example (allows custom_attribute="value" in html tags):
      <entry key="additional_allowed_attributes" class="array">
        <value>custom_attribute</value>
      </entry>