recent.phtml 997 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright © 2015 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 sidebar recent posts template
  12. *
  13. * @var $block \Magefan\Blog\Block\Sidebar\Recent
  14. */
  15. ?>
  16. <?php
  17. $_postCollection = $block->getPostCollection();
  18. ?>
  19. <?php if ($_postCollection->count()) { ?>
  20. <div class="widget block block-recent-posts" data-bind="scope: 'recemt-posts'">
  21. <div class="block-title">
  22. <strong><?php echo __('Recent Posts') ?></strong>
  23. </div>
  24. <div class="block-content">
  25. <?php foreach ($_postCollection as $_post) { ?>
  26. <div class="item">
  27. <a class="post-item-link"
  28. href="<?php echo $_post->getPostUrl() ?>">
  29. <?php echo $block->escapeHtml($_post->getTitle()) ?>
  30. </a>
  31. </div>
  32. <?php } ?>
  33. </div>
  34. </div>
  35. <?php } ?>