public function AmpFormTrait::layoutElement in Accelerated Mobile Pages (AMP) 8.3
The layout form element.
Return value
array A form element.
5 calls to AmpFormTrait::layoutElement()
- AmpImageCarousel::settingsForm in src/
Plugin/ Field/ FieldFormatter/ AmpImageCarousel.php - Returns a form to configure settings for the formatter.
- AmpImageFormatter::settingsForm in src/
Plugin/ Field/ FieldFormatter/ AmpImageFormatter.php - Returns a form to configure settings for the formatter.
- AmpSocialPostFormatter::settingsForm in src/
Plugin/ Field/ FieldFormatter/ AmpSocialPostFormatter.php - Returns a form to configure settings for the formatter.
- AmpVideoFormatter::settingsForm in src/
Plugin/ Field/ FieldFormatter/ AmpVideoFormatter.php - Returns a form to configure settings for the formatter.
- AmpViewsCarouselStyle::buildOptionsForm in src/
Plugin/ views/ style/ AmpViewsCarouselStyle.php - Provide a form to edit options for this plugin.
File
- src/
AmpFormTrait.php, line 114
Class
- AmpFormTrait
- AMP Form trait.
Namespace
Drupal\ampCode
public function layoutElement() {
$info_url = 'https://www.ampproject.org/docs/guides/responsive/control_layout.html';
$element = [
'#title' => t('AMP Layout'),
'#type' => 'select',
'#default_value' => $this
->getSetting('layout'),
'#empty_option' => t('- None -'),
'#options' => $this
->getLayouts(),
'#description' => $this
->t('<a href=":url" target="_blank">AMP Layout Information</a>', [
':url' => $info_url,
]),
];
return $element;
}