You are here

public function FederatedTermsProperty::buildConfigurationForm in Search API Federated Solr 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/processor/Property/FederatedTermsProperty.php \Drupal\search_api_federated_solr\Plugin\search_api\processor\Property\FederatedTermsProperty::buildConfigurationForm()
  2. 8 src/Plugin/search_api/processor/Property/FederatedTermsProperty.php \Drupal\search_api_federated_solr\Plugin\search_api\processor\Property\FederatedTermsProperty::buildConfigurationForm()
  3. 4.x src/Plugin/search_api/processor/Property/FederatedTermsProperty.php \Drupal\search_api_federated_solr\Plugin\search_api\processor\Property\FederatedTermsProperty::buildConfigurationForm()

Constructs a configuration form for a field based on this property.

Parameters

\Drupal\search_api\Item\FieldInterface $field: The field for which the configuration form is constructed.

array $form: An associative array containing the initial structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the complete form.

Return value

array The form structure.

Overrides ConfigurablePropertyInterface::buildConfigurationForm

File

src/Plugin/search_api/processor/Property/FederatedTermsProperty.php, line 32

Class

FederatedTermsProperty
Defines an "federated terms" property.

Namespace

Drupal\search_api_federated_solr\Plugin\search_api\processor\Property

Code

public function buildConfigurationForm(FieldInterface $field, array $form, FormStateInterface $form_state) {
  $form['#attached']['library'][] = 'search_api/drupal.search_api.admin_css';
  $form['#tree'] = TRUE;
  $form['field_data'] = [
    '#type' => 'item',
    '#title' => $this
      ->t('Federated terms'),
    '#description' => $this
      ->t('By adding this field to your search index configuration, you have enabled the federated terms processor to run when new items are indexed.  Next, add a "Federated Terms" field to any taxonomy vocabulary whose terms should be mapped to a "federated" term (this helps map terms across vocabularies and sites to a single "federated" term).  Then, edit terms in those vocabularies to add the federated term destination value (i.e. "Conditions>Blood Disorders").  Once that tagged content gets indexed, it will have "federated_terms" populated with any matching federated term destination values.'),
  ];
  return $form;
}