Skip to content

Commit 35aa07c

Browse files
WouterSteenpeterjaap
authored andcommitted
Robots meta data block
1 parent 6d856c3 commit 35aa07c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Block/Layout/Metadata/Robots.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Elgentos\PrismicIO\Block\Layout\Metadata;
4+
5+
use Elgentos\PrismicIO\Block\AbstractTemplate;
6+
7+
class Robots extends AbstractTemplate
8+
{
9+
protected function _prepareLayout()
10+
{
11+
if (! $this->getDocumentResolver()->hasDocument()) {
12+
return $this;
13+
}
14+
15+
$this->pageConfig->setMetadata('robots', $this->getChildHtml());
16+
return $this;
17+
}
18+
}

0 commit comments

Comments
 (0)