view.phtml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 post view template
  12. *
  13. * @var $block \Magefan\Blog\Block\Post\View
  14. */
  15. ?>
  16. <?php
  17. $_post = $this->getPost();
  18. $_postUrl = $_post->getPostUrl();
  19. $_postName = $block->escapeHtml($_post->getTitle(), null, true);
  20. $imageHelper = $this->helper('Magefan\Blog\Helper\Image');
  21. $imageWidth = 500;
  22. $imageHeight = 200;
  23. ?>
  24. <div class="post-view">
  25. <div class="post-holder post-holder-<?php echo $_post->getId() ?>">
  26. <div class="post-content">
  27. <div class="post-description clearfix">
  28. <?php if ($featuredImage = $_post->getFeaturedImage()) { ?>
  29. <div class="post-ftimg-hld">
  30. <amp-img layout="responsive" width="<?php echo $imageWidth ?>" height="<?php echo $imageHeight ?>" src="<?php echo $this->helper('Magefan\Blog\Helper\Image')->init($_post->getFeaturedImg())->resize($imageWidth, $imageHeight) ?>" alt="<?php echo $_postName ?>"></amp-img>
  31. </div>
  32. <?php } ?>
  33. <div class="post-text-hld">
  34. <?php echo $block->getContent() ?>
  35. <div class="clear"></div>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="post-bottom">
  40. <?php echo $this->getChildHtml('blog.post.bottom') ?>
  41. </div>
  42. </div>
  43. </div>