diff --git a/view/frontend/templates/post/list/item.phtml b/view/frontend/templates/post/list/item.phtml index c44c72d5..f965df1e 100644 --- a/view/frontend/templates/post/list/item.phtml +++ b/view/frontend/templates/post/list/item.phtml @@ -16,7 +16,11 @@ getPost(); $_postUrl = $block->escapeUrl($_post->getPostUrl()); +$_postImage = $_post->getFeaturedImg(); $_postName = $block->escapeHtml($_post->getTitle()); + +$imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); +$imageWidth = (int)$block->getFeaturedImageWidth() ?: 722; ?>
  • @@ -52,9 +56,11 @@ $_postName = $block->escapeHtml($_post->getTitle());
    - getFeaturedListImage() ?: $_post->getFeaturedImage(); ?> + getFeaturedListImg() ?: $_post->getFeaturedImg(); ?> init($featuredImage)->resize($imageWidth, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); $featuredImgAlt = $_post->getData('featured_list_img_alt') ?: $_post->getData('featured_img_alt'); if (!$featuredImgAlt) { $featuredImgAlt = $_postName; @@ -63,7 +69,8 @@ $_postName = $block->escapeHtml($_post->getTitle());
    - alt="escapeHtml($featuredImgAlt) ?>" />
    diff --git a/view/frontend/templates/post/view-modern.phtml b/view/frontend/templates/post/view-modern.phtml index bee8593e..ecb85c4b 100644 --- a/view/frontend/templates/post/view-modern.phtml +++ b/view/frontend/templates/post/view-modern.phtml @@ -14,9 +14,13 @@ */ ?> getPost(); - $_postUrl = $_post->getPostUrl(); - $_postName = $block->escapeHtml($_post->getTitle(), null); +$_post = $block->getPost(); +$_postUrl = $_post->getPostUrl(); +$_postImage = $_post->getFeaturedImg(); +$_postName = $block->escapeHtml($_post->getTitle(), null); + +$imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); +$imageWidth = (int)$block->getFeaturedImageWidth() ?: 722; ?> getStyleViewModel()->getStyle('Magefan_Blog::css/bootstrap-4.4.1-custom-min.css') ?>
    @@ -27,13 +31,13 @@ getCategoriesCount()) { ?> + getParentCategories() as $ct) { ?> + + escapeHtml($ct->getTitle()) ?> + + +
    @@ -51,8 +55,8 @@ getRelatedCoauthors(); - $coAuthorsCount = count($coAuthors); + $coAuthors = $_post->getRelatedCoauthors(); + $coAuthorsCount = count($coAuthors); ?> escapeHtml(__('and')) ?> @@ -106,15 +110,18 @@
    - getFeaturedImage()) { ?> + getFeaturedImg()) { ?> getData('featured_img_alt'); - if (!$featuredImgAlt) { - $featuredImgAlt = $_postName; - } + $featuredImage = $imageHelper->init($featuredImage)->resize($imageWidth, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); + $featuredImgAlt = $_post->getData('featured_img_alt'); + if (!$featuredImgAlt) { + $featuredImgAlt = $_postName; + } ?>
    - alt="escapeHtml($featuredImgAlt) ?>" />
    @@ -146,20 +153,20 @@
    displayAddThisToolbox()) : ?> - -
    -