You are here

function gc_gc_process_section_field in GatherContent 8

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

Parameters

EntityMetadataWrapper $node: Object of node.

string $local_field_name: Local field name.

string $gc_field_name: Name of field in GatherContent.

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

File

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

Code

function gc_gc_process_section_field(EntityMetadataWrapper &$node, $local_field_name, $gc_field_name, $is_translatable = FALSE, $language = 'und', $field) {
  if ($is_translatable) {
    $node
      ->language($language)->{$local_field_name}
      ->set(array(
      'value' => '<h3>' . $field->title . '</h3>' . $field->subtitle,
      'format' => 'filtered_html',
    ));
  }
  else {
    $node->{$local_field_name}
      ->set(array(
      'value' => '<h3>' . $field->title . '</h3>' . $field->subtitle,
      'format' => 'filtered_html',
    ));
  }
}