/**
  * Load your component.
  *
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page       The resolved page
  */
 public function load(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     global $_CORELANG, $objTemplate, $subMenuTitle;
     switch ($this->cx->getMode()) {
         case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
             $newsObj = new News($page->getContent());
             $page->setContent($newsObj->getNewsPage());
             $newsObj->getPageTitle($page->getTitle());
             if (substr($page->getCmd(), 0, 7) == 'details') {
                 $page->setTitle($newsObj->newsTitle);
                 $page->setContentTitle($newsObj->newsTitle);
                 $page->setMetaTitle($newsObj->newsTitle);
                 // Set the meta page description to the teaser text if displaying news details
                 $teaser = $newsObj->getTeaser();
                 if ($teaser) {
                     $page->setMetadesc(contrexx_raw2xhtml(contrexx_strip_tags(html_entity_decode($teaser, ENT_QUOTES, CONTREXX_CHARSET))));
                 } else {
                     $page->setMetadesc(contrexx_raw2xhtml(contrexx_strip_tags(html_entity_decode($newsObj->newsText, ENT_QUOTES, CONTREXX_CHARSET))));
                 }
                 // Set the meta page image to the thumbnail if displaying news details
                 $image = $newsObj->newsThumbnail;
                 if ($image) {
                     $page->setMetaimage($image);
                 }
             }
             break;
         case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
             $this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
             $objTemplate = $this->cx->getTemplate();
             \Permission::checkAccess(10, 'static');
             $subMenuTitle = $_CORELANG['TXT_NEWS_MANAGER'];
             $objNews = new NewsManager();
             $objNews->getPage();
             break;
         default:
             break;
     }
 }
 public function postContentLoad(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     // Set meta image to default if it's not defined
     if (empty($page->getMetaimage())) {
         $page->setMetaimage(\Env::get('config')['defaultMetaimage']);
     }
 }
 public function setMetaimage($metaimage)
 {
     $this->_load();
     return parent::setMetaimage($metaimage);
 }