<?php
/**
 * Copyright © 2015 Ihor Vansach (ihor@magefan.com). All rights reserved.
 * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
 *
 * Glory to Ukraine! Glory to the heroes!
 */
?>
<?php
/**
 * Blog rss feed template
 *
 * @var $block \Magefan\Blog\Block\Rss\Feed
 */
?>
<?php $_postCollection = $block->getPostCollection(); ?>
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
   <title><?php echo $block->escapeHtml($this->getTitle()) ?></title>
   <link><?php echo $this->getLink() ?></link>
   <description><?php echo $block->escapeHtml($this->getDescription()) ?></description>
   <?php foreach($_postCollection as $_post) { ?>
   <item>
      <title><?php echo $block->escapeHtml($_post->getTitle(), null, true) ?></title>
      <link><?php echo $_post->getPostUrl() ?></link>
      <description><![CDATA[<?php echo substr($block->stripTags($_post->getContent()), 0, 255) ?>]]></description>
      <?php if ($featuredImage = $_post->getFeaturedImage()) { ?>
         <image><?php echo $featuredImage ?></image>
      <?php } ?>
   </item>
   <?php } ?>
</channel>
</rss>