class CanonicalUrlProperty in Search API Field Map 4.x
Same name and namespace in other branches
- 8.3 src/Plugin/search_api/processor/Property/CanonicalUrlProperty.php \Drupal\search_api_field_map\Plugin\search_api\processor\Property\CanonicalUrlProperty
- 8 src/Plugin/search_api/processor/Property/CanonicalUrlProperty.php \Drupal\search_api_field_map\Plugin\search_api\processor\Property\CanonicalUrlProperty
Defines a "Canonical URL" property.
Hierarchy
- class \Drupal\search_api_field_map\Plugin\search_api\processor\Property\CanonicalUrlProperty extends \Drupal\search_api\Processor\ConfigurablePropertyBase uses StringTranslationTrait
Expanded class hierarchy of CanonicalUrlProperty
See also
\Drupal\search_api\Plugin\search_api\processor\Urls
1 file declares its use of CanonicalUrlProperty
- CanonicalUrl.php in src/
Plugin/ search_api/ processor/ CanonicalUrl.php
File
- src/
Plugin/ search_api/ processor/ Property/ CanonicalUrlProperty.php, line 15
Namespace
Drupal\search_api_field_map\Plugin\search_api\processor\PropertyView source
class CanonicalUrlProperty extends ConfigurablePropertyBase {
use StringTranslationTrait;
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [
'canonical_url' => '',
];
}
/**
* {@inheritdoc}
*/
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('Canonical URL'),
'#description' => $this
->t('Preferred URL for this content.'),
];
return $form;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CanonicalUrlProperty:: |
public | function | ||
CanonicalUrlProperty:: |
public | function | ||
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |