public function CustomSearchV2Ad::getAdPlaceholder in Google AdSense integration 8
Return the ad placeholder.
Return value
array ad placeholder
Overrides AdsenseAdInterface::getAdPlaceholder
File
- src/
Plugin/ AdsenseAd/ CustomSearchV2Ad.php, line 39
Class
- CustomSearchV2Ad
- Provides an AdSense custom search engine form.
Namespace
Drupal\adsense\Plugin\AdsenseAdCode
public function getAdPlaceholder() {
if (!empty($this->slot)) {
$client = PublisherId::get();
$content = "CSE v2\ncx = partner-{$client}:{$this->slot}";
return [
'#content' => [
'#markup' => nl2br($content),
],
'#format' => 'Search Box v2',
];
}
return [];
}