function gc_gc_process_metatag_pane in GatherContent 8
Same name and namespace in other branches
- 8.3 gathercontent.module \gc_gc_process_metatag_pane()
Parameters
EntityMetadataWrapper $node: Object of node.
array $metatags: Array of metatags.
int $gc_id: ID of item in GatherContent.
string $local_field_name: Name of local Drupal field.
object $field: Object of GatherContent field.
string $content_type: Name of Content type, we are mapping to.
bool $is_translatable: Indicator if node is translatable.
string $language: Language of translation if applicable.
Throws
\Exception
1 call to gc_gc_process_metatag_pane()
- _gc_fetcher in ./
gathercontent.module - Helper function for fetching data from GatherContent.
File
- ./
gathercontent.module, line 195 - Main module file for GatherContent module.
Code
function gc_gc_process_metatag_pane(EntityMetadataWrapper &$node, &$metatags, $gc_id, $local_field_name, $field, $content_type, $is_translatable = FALSE, $language = \Drupal\Core\Language\Language::LANGCODE_NOT_SPECIFIED) {
if (\Drupal::moduleHandler()
->moduleExists('metatag') && metatag_entity_supports_metatags('node', $content_type)) {
$metatags[$language][$local_field_name] = array(
'value' => $field->value,
);
}
else {
throw new Exception("Metatag module not enabled or entity doesn't support \n metatags while trying to map values woth metatag content.");
}
}