public function ContextMetadata::buildConfigurationForm in Context Metadata 8
Same name and namespace in other branches
- 8.2 src/Plugin/ContextReaction/ContextMetadata.php \Drupal\context_metadata\Plugin\ContextReaction\ContextMetadata::buildConfigurationForm()
File
- src/Plugin/ContextReaction/ContextMetadata.php, line 21
Class
- ContextMetadata
- Provides a content reaction that adds a Metadata.
Namespace
Drupal\context_metadata\Plugin\ContextReaction
Code
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['metadata_title'] = array(
'#title' => $this
->t('Meta Title'),
'#description' => $this
->t('Title goes here'),
'#type' => 'textfield',
'#maxlength' => 256,
'#default_value' => $this
->getConfiguration()['metadata_title'],
);
$form['metadata_description'] = array(
'#title' => $this
->t('Meta Description'),
'#description' => $this
->t('Meta Description'),
'#type' => 'textfield',
'#maxlength' => 400,
'#default_value' => $this
->getConfiguration()['metadata_description'],
);
$form['metadata_keywords'] = array(
'#title' => $this
->t('Meta Keywords'),
'#description' => $this
->t('Meta Keywords'),
'#type' => 'textfield',
'#maxlength' => 400,
'#default_value' => $this
->getConfiguration()['metadata_keywords'],
);
$form['metadata_canonical_url'] = array(
'#title' => $this
->t('Canonical URL'),
'#description' => $this
->t('Canonical URL'),
'#type' => 'textfield',
'#maxlength' => 400,
'#default_value' => $this
->getConfiguration()['metadata_canonical_url'],
);
return $form;
}