public function AmpFormTrait::layoutSelector in Accelerated Mobile Pages (AMP) 8.3
The #states layout selector.
Return value
string A selector that can be used with #states to adjust options based on the selected layout.
1 call to AmpFormTrait::layoutSelector()
- AmpSocialPostFormatter::settingsForm in src/
Plugin/ Field/ FieldFormatter/ AmpSocialPostFormatter.php - Returns a form to configure settings for the formatter.
File
- src/
AmpFormTrait.php, line 66
Class
- AmpFormTrait
- AMP Form trait.
Namespace
Drupal\ampCode
public function layoutSelector() {
// The layout selector varies depending on whether this is a views style
// plugin or a field formatter plugin.
if ($this instanceof StylePluginBase) {
return ':input[name="style_options[settings][layout]"]';
}
else {
return ':input[name="fields[' . $this->fieldDefinition
->getName() . '][settings_edit_form][settings][layout]"]';
}
}