public function setTemplatefields($contentKey, $className)
    {
        if (!isset($this->contenttypes[$contentKey]['templatefields'])) {
            return;
        }

        $config = $this->contenttypes[$contentKey]['templatefields'];

        foreach ($config as &$template) {
            foreach ($template['fields'] as &$field) {
                $this->postProcessField($field);
            }
        }
        $mapping = [
            'fieldname' => 'templatefields',
            'type'      => 'json',
            'fieldtype' => $this->typemap['templatefields'],
            'config'    => $config,
        ];

        $this->metadata[$className]['fields']['templatefields'] = $mapping;
    }
public function setTemplatefields($contentKey, $className)
    {
        if (!isset($this->contenttypes[$contentKey]['templatefields'])) {
            return;
        }

        $config = $this->contenttypes[$contentKey]['templatefields'];

        foreach ($config as &$template) {
            foreach ($template['fields'] as &$field) {
                $this->postProcessField($field);
            }
        }
        $mapping = [
            'fieldname' => 'templatefields',
            'type'      => 'json',
            'fieldtype' => $this->typemap['templatefields'],
            'config'    => $config,
        ];

        $this->metadata[$className]['fields']['templatefields'] = $mapping;
    }
public function setTemplatefields ( $ contentKey , $ className ) { if ( ! isset ( $ this -> contenttypes [ $ contentKey ] [ 'templatefields' ] ) ) { return ; } $ config = $ this -> contenttypes [ $ contentKey ] [ 'templatefields' ] ; foreach ( $ config as & $ template ) { foreach ( $ template [ 'fields' ] as & $ field ) { $ this -> postProcessField ( $ field ) ; } } $ mapping = [ 'fieldname' => 'templatefields' , 'type' => 'json' , 'fieldtype' => $ this -> typemap [ 'templatefields' ] , 'config' => $ config , ] ; $ this -> metadata [ $ className ] [ 'fields' ] [ 'templatefields' ] = $ mapping ; }
Setup a templatefields field if needed.

@param string $contentKey
@param string $className
Setup a templatefields field if needed .