<?php // set page meta-data $this->headTitle()->set($this->article->getTitle()); $description = strip_tags($this->article->getText()); $description = \Website\Tool\Text::getStringAsOneLine($description); $description = \Website\Tool\Text::cutStringRespectingWhitespace($description, 160); $this->headMeta($description, "description"); ?> <section class="area-wysiwyg"> <div class="page-header"> <h1><?php echo $this->article->getTitle(); ?> </h1> </div> <?php $this->template("blog/meta.php"); ?> <hr /> <?php if ($this->article->getPosterImage()) { ?> <?php echo $this->article->getPosterImage()->getThumbnail("content")->getHTML(); ?> <br /><br />
<?php // add autogenerated meta description $this->headMeta()->setName('description', \Website\Tool\Text::cutStringRespectingWhitespace(\Website\Tool\Text::getStringAsOneLine(strip_tags($this->wysiwyg("content")->getData())), 160)); ?> <section class="area-wysiwyg"> <?php $this->glossary()->start(); ?> <?php echo $this->wysiwyg("content"); ?> <?php $this->glossary()->stop(); ?> </section>
/** * @param string $format * @return Zend_Feed_Abstract */ public function getFeed($format = 'rss') { if ($format != 'rss' && $format != 'atom') { throw new Zend_Controller_Action_Exception("Feed type {$format} is not supported"); } $url = new Pimcore_View_Helper_Url(); $host = 'http://' . $_SERVER['HTTP_HOST']; $feed = array('title' => '', 'copyright' => '', 'link' => $host . 'plugin/Blog/entry/feed/format/' . $format, 'charset' => 'utf-8', 'language' => 'pl-pl', 'lastUpdate' => time(), 'published' => time(), 'entries' => array()); if ($this->_options->feed) { $feed = array_merge($feed, $this->_options->feed->toArray()); } foreach ($this->getList() as $entry) { if ($entry instanceof Object_BlogEntry) { $description = ''; if (trim($entry->getSummary())) { $description = $entry->getSummary(); } else { if (class_exists('Website_Tool_Text')) { $description = Website_Tool_Text::cutStringRespectingWhitespace(trim(strip_tags($entry->getContent())), 200); } elseif (class_exists('\\Website\\Tool\\Text')) { $description = \Website\Tool\Text::cutStringRespectingWhitespace(trim(strip_tags($entry->getContent())), 200); } } $feed['entries'][] = array('title' => $entry->getTitle(), 'link' => $host . $url->url(array('key' => $entry->getKey()), 'blog-show'), 'description' => $description, 'lastUpdate' => $entry->getDate()->getTimestamp()); if ($entry->getModificationDate() < $feed['lastUpdate']) { $feed['lastUpdate'] = $feed['published'] = $entry->getModificationDate(); } } } return Zend_Feed::importArray($feed, $format); }