feed.phtml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © 2016 Ihor Vansach (ihor@magefan.com). All rights reserved.
  4. * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
  5. *
  6. * Glory to Ukraine! Glory to the heroes!
  7. */
  8. ?>
  9. <?php
  10. /**
  11. * Blog rss feed template
  12. *
  13. * @var $block \Magefan\Blog\Block\Rss\Feed
  14. */
  15. ?>
  16. <?php $_postCollection = $block->getPostCollection(); ?>
  17. <?php echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\r\n" ?>
  18. <rss version="2.0">
  19. <channel>
  20. <title><?php echo $block->escapeHtml($this->getTitle()) ?></title>
  21. <link><?php echo $this->getLink() ?></link>
  22. <description><?php echo $block->escapeHtml($this->getDescription()) ?></description>
  23. <?php foreach($_postCollection as $_post) { ?>
  24. <item>
  25. <title><?php echo $block->escapeHtml($_post->getTitle(), null, true) ?></title>
  26. <link><?php echo $_post->getPostUrl() ?></link>
  27. <description><![CDATA[<?php echo $_post->getFilteredContent() ?>]]></description>
  28. <?php if ($featuredImage = $_post->getFeaturedImage()) { ?>
  29. <image><?php echo $featuredImage ?></image>
  30. <?php } ?>
  31. <pubDate><?php echo $_post->getPublishDate('c') ?></pubDate>
  32. <?php foreach($_post->getParentCategories() as $category) { ?>
  33. <category><![CDATA[<?php echo $category->getTitle() ?>]]></category>
  34. <?php } ?>
  35. </item>
  36. <?php } ?>
  37. </channel>
  38. </rss>