コード例 #1
0
 /**
  * @param SeoAwareInterface $content
  * @param ItemInterface $itemInterface
  */
 public function updateMetadata($content, ItemInterface $itemInterface)
 {
     $seoMetaData = $content->getSeoMetadata();
     $itemInterface->setTitle($seoMetaData->getTitle());
     $itemInterface->setDescription($seoMetaData->getMetaDescription());
     $itemInterface->setLink($seoMetaData->getOriginalUrl());
 }
コード例 #2
0
 /**
  * @param SeoAwareInterface $content
  * @param ChannelInterface $channel
  */
 public function updateMetadata($content, ChannelInterface $channel)
 {
     $seoMetaData = $content->getSeoMetadata();
     $channel->setTitle($seoMetaData->getTitle());
     $channel->setDescription($seoMetaData->getMetaDescription());
     $channel->setLink($seoMetaData->getOriginalUrl());
 }
コード例 #3
0
 /**
  * The seo metadata that was edited embedded has the same locale as the
  * containing document.
  *
  * @param SeoAwareInterface $seoAware
  */
 private function propagateLocale(SeoAwareInterface $seoAware)
 {
     if (!$seoAware instanceof TranslatableInterface) {
         return;
     }
     $seoMetadata = $seoAware->getSeoMetadata();
     if (!$seoMetadata instanceof TranslatableInterface) {
         return;
     }
     $seoMetadata->setLocale($seoAware->getLocale());
 }