You are here

protected function ThunderMetaTagTrait::getMetaTagFieldName in Thunder 8.5

Same name and namespace in other branches
  1. 8.2 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::getMetaTagFieldName()
  2. 8.3 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::getMetaTagFieldName()
  3. 8.4 tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::getMetaTagFieldName()
  4. 6.2.x tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::getMetaTagFieldName()
  5. 6.0.x tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::getMetaTagFieldName()
  6. 6.1.x tests/src/FunctionalJavascript/ThunderMetaTagTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMetaTagTrait::getMetaTagFieldName()

Get field name for meta tag.

Parameters

string $metaTagName: Meta tag name.

string $groupName: Group name where meta tag belongs (fe. basic, advanced, open_graph, ..)

string $fieldNamePrefix: Field name prefix (fe. field_meta_tags[0])

Return value

string Full meta tag field name that can be used to set value for it.

1 call to ThunderMetaTagTrait::getMetaTagFieldName()
MetaInformationTest::checkSavedConfiguration in tests/src/FunctionalJavascript/MetaInformationTest.php
Check saved configuration on meta tag overview page.

File

tests/src/FunctionalJavascript/ThunderMetaTagTrait.php, line 25

Class

ThunderMetaTagTrait
Trait for manipulation of meta tag configuration and meta tags on page.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

protected function getMetaTagFieldName($metaTagName, $groupName = '', $fieldNamePrefix = '') {

  // Based on examples, this way of forming field name works properly.
  $fieldName = str_replace([
    '.',
    ':',
  ], '_', $metaTagName);
  if (empty($groupName) && empty($fieldNamePrefix)) {
    return $fieldName;
  }
  return $fieldNamePrefix . '[' . $groupName . '][' . $fieldName . ']';
}