You are here

function gc_gc_process_section_field in GatherContent 8.3

Same name and namespace in other branches
  1. 8 gathercontent.module \gc_gc_process_section_field()

Processing function for section type of field.

Parameters

\Drupal\node\NodeInterface $node: Object of node.

string $local_field_name: Local field name.

bool $is_translatable: Indicator if node is translatable.

string $language: Language of translation if applicable.

object $field: Object with field attributes.

1 call to gc_gc_process_section_field()
gc_gc_process_content_pane in ./gathercontent.module
Processing function for content panes.

File

./gathercontent.module, line 561
Main module file for GatherContent module.

Code

function gc_gc_process_section_field(NodeInterface &$node, $local_field_name, $is_translatable, $language, $field) {
  if ($is_translatable) {
    $node
      ->getTranslation($language)->{$local_field_name} = [
      'value' => '<h3>' . $field->title . '</h3>' . $field->subtitle,
      'format' => 'basic_html',
    ];
  }
  else {
    $node->{$local_field_name} = [
      'value' => '<h3>' . $field->title . '</h3>' . $field->subtitle,
      'format' => 'basic_html',
    ];
  }
}