From f58447105f967ab83229fcac25065a6c230cdbfa Mon Sep 17 00:00:00 2001 From: Serhii Kozak Date: Wed, 19 Mar 2025 18:06:02 +0200 Subject: [PATCH 1/4] 13108-Preview-for-the-social-sharing-buttons --- view/frontend/templates/addthis-js.phtml | 6 +- view/frontend/templates/post/list/item.phtml | 3 +- .../frontend/templates/post/view-modern.phtml | 57 ++++++++++--------- view/frontend/templates/post/view.phtml | 3 +- 4 files changed, 36 insertions(+), 33 deletions(-) diff --git a/view/frontend/templates/addthis-js.phtml b/view/frontend/templates/addthis-js.phtml index 0be7b20e..b1c393f2 100644 --- a/view/frontend/templates/addthis-js.phtml +++ b/view/frontend/templates/addthis-js.phtml @@ -8,12 +8,12 @@ ?> getPost(); $_postUrl = $block->escapeUrl($_post->getPostUrl()); +$_postImage = $_post->getOgImage()? $_post->getOgImage() : $_post->getFeaturedImage(); $_postName = $block->escapeHtml($_post->getTitle()); ?>
  • @@ -34,7 +35,7 @@ $_postName = $block->escapeHtml($_post->getTitle());
  • @@ -56,6 +59,8 @@ $_postName = $block->escapeHtml($_post->getTitle()); getFeaturedListImage() ?: $_post->getFeaturedImage(); ?> 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; @@ -64,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 dc7223ee..22b26872 100644 --- a/view/frontend/templates/post/view-modern.phtml +++ b/view/frontend/templates/post/view-modern.phtml @@ -18,6 +18,9 @@ $_post = $block->getPost(); $_postUrl = $_post->getPostUrl(); $_postImage = $_post->getOgImage()? $_post->getOgImage() : $_post->getFeaturedImage(); $_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') ?>
    @@ -109,13 +112,16 @@ $_postName = $block->escapeHtml($_post->getTitle(), null); getFeaturedImage()) { ?> init($featuredImage)->resize($imageWidth, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); $featuredImgAlt = $_post->getData('featured_img_alt'); if (!$featuredImgAlt) { $featuredImgAlt = $_postName; } ?>
    - alt="escapeHtml($featuredImgAlt) ?>" />
    diff --git a/view/frontend/templates/post/view.phtml b/view/frontend/templates/post/view.phtml index dcad4777..b670dfc6 100644 --- a/view/frontend/templates/post/view.phtml +++ b/view/frontend/templates/post/view.phtml @@ -18,6 +18,9 @@ $_post = $block->getPost(); $_postUrl = $_post->getPostUrl(); $_postImage = $_post->getOgImage()? $_post->getOgImage() : $_post->getFeaturedImage(); $_postName = $block->escapeHtml($_post->getTitle(), null); + +$imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); +$imageWidth = (int)$block->getFeaturedImageWidth() ?: 722; ?>
    @@ -47,13 +50,16 @@ $_postName = $block->escapeHtml($_post->getTitle(), null);
    getFeaturedImage()) { ?> init($featuredImage)->resize($imageWidth, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); $featuredImgAlt = $_post->getData('featured_img_alt'); if (!$featuredImgAlt) { $featuredImgAlt = $_postName; } ?>
    - alt="escapeHtml($featuredImgAlt) ?>" />
    diff --git a/view/frontend/templates/post/view/comments/magefan.phtml b/view/frontend/templates/post/view/comments/magefan.phtml index 4d59c1fc..abc88398 100644 --- a/view/frontend/templates/post/view/comments/magefan.phtml +++ b/view/frontend/templates/post/view/comments/magefan.phtml @@ -19,6 +19,9 @@ $session = $block->getCustomerSession(); $canPost = $block->canPost(); + + $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); + $imageWidth = (int)$block->getFeaturedImageWidth() ?: ''; ?>
    @@ -27,8 +30,15 @@
    getCustomerImage()) { ?> + init($image)->resize($imageWidth, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); + ?> +
    - <?= $block->escapeHtml($block->getCustomerName()) ?> + + alt="escapeHtml($block->getCustomerName()) ?>">
    diff --git a/view/frontend/templates/post/view/comments/magefan/comment.phtml b/view/frontend/templates/post/view/comments/magefan/comment.phtml index 83809652..1f8a0edd 100644 --- a/view/frontend/templates/post/view/comments/magefan/comment.phtml +++ b/view/frontend/templates/post/view/comments/magefan/comment.phtml @@ -16,12 +16,21 @@ getComment(); $numberOfCommentsToDisplay = $block->getNumberOfReplies(); + + $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); + $imageWidth = (int)$block->getFeaturedImageWidth() ?: 772; ?>
    getIsHidden()) { echo 'style="display:none"'; } ?>> getAuthorImage()) { ?> + init($authorImage)->resize($imageWidth, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); + ?>
    - <?= $block->escapeHtml($comment->getAuthorName()) ?> + + alt="escapeHtml($comment->getAuthorName()) ?>">
    diff --git a/view/frontend/templates/sidebar/recent.phtml b/view/frontend/templates/sidebar/recent.phtml index baf3a331..ac81ca11 100755 --- a/view/frontend/templates/sidebar/recent.phtml +++ b/view/frontend/templates/sidebar/recent.phtml @@ -47,11 +47,13 @@ init($_post->getFeaturedListImg() ?: $_post->getFeaturedImg())->resize($width, $height); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); } else { $featuredImageUrl = $this->getViewFileUrl('Magefan_Blog::images/default-no-image.png'); } ?> alt="escapeHtml($featuredImgAlt) ?>" />
    diff --git a/view/frontend/templates/themes/smartwave_porto/recent_home_custom.phtml b/view/frontend/templates/themes/smartwave_porto/recent_home_custom.phtml index 88123ea5..0a2d030f 100644 --- a/view/frontend/templates/themes/smartwave_porto/recent_home_custom.phtml +++ b/view/frontend/templates/themes/smartwave_porto/recent_home_custom.phtml @@ -18,6 +18,9 @@ getPostCollection(); $id = rand(10000, 20000); + + $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); + $imageWidth = (int)$block->getFeaturedImageWidth() ?: ''; ?> count()) { ?> @@ -49,7 +52,13 @@
    getFeaturedImage()) { ?> - <?= $block->escapeHtml($featuredImgAlt) ?> + init($post_image)->resize($imageWidth, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); + ?> + + alt="escapeHtml($featuredImgAlt) ?>" />
    diff --git a/view/frontend/templates/widget/recent.phtml b/view/frontend/templates/widget/recent.phtml index 20a3963c..c4674189 100755 --- a/view/frontend/templates/widget/recent.phtml +++ b/view/frontend/templates/widget/recent.phtml @@ -72,6 +72,7 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); init($featuredImage)->resize($width, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); $featuredImgAlt = $_post->getData('featured_list_img_alt') ?: $_post->getData('featured_img_alt'); if (!$featuredImgAlt) { $featuredImgAlt = $_postName; @@ -79,7 +80,8 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); ?>
    - alt="escapeHtml($featuredImgAlt) ?>" />
    diff --git a/view/frontend/templates/widget/recent_masonry.phtml b/view/frontend/templates/widget/recent_masonry.phtml index a64a15e6..37b837b2 100755 --- a/view/frontend/templates/widget/recent_masonry.phtml +++ b/view/frontend/templates/widget/recent_masonry.phtml @@ -73,6 +73,7 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); init($featuredImage)->resize($width, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); $featuredImgAlt = $_post->getData('featured_list_img_alt') ?: $_post->getData('featured_img_alt'); if (!$featuredImgAlt) { $featuredImgAlt = $_postName; @@ -80,7 +81,8 @@ $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); ?>
    - alt="escapeHtml($featuredImgAlt) ?>" />
    From 1334089888313298f696d8f2f0734bf977cde7f8 Mon Sep 17 00:00:00 2001 From: Serhii Kozak Date: Fri, 23 May 2025 16:25:54 +0300 Subject: [PATCH 3/4] 13093-getWidthAndHeigth-method-for-blog --- view/frontend/templates/addthis-js.phtml | 6 +++--- view/frontend/templates/post/list-modern.phtml | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/view/frontend/templates/addthis-js.phtml b/view/frontend/templates/addthis-js.phtml index b1c393f2..0be7b20e 100644 --- a/view/frontend/templates/addthis-js.phtml +++ b/view/frontend/templates/addthis-js.phtml @@ -8,12 +8,12 @@ ?> helper(\Magefan\Blog\Helper\Image::class); init($featuredImage)->resize($width, null, false); - $widthAndHeight = $imageHelper->getWidthAndHeigth(); $featuredImgAlt = $_post->getData('featured_list_img_alt') ?: $_post->getData('featured_img_alt'); if (!$featuredImgAlt) { $featuredImgAlt = $_postName; From 8a3df91cb7ac92082ac78262590628bee288cc2a Mon Sep 17 00:00:00 2001 From: Serhii Kozak Date: Mon, 26 May 2025 12:23:33 +0300 Subject: [PATCH 4/4] 13093-getWidthAndHeigth-method-for-blog --- view/frontend/templates/post/list/item.phtml | 6 +++--- view/frontend/templates/post/view-modern.phtml | 4 ++-- view/frontend/templates/post/view.phtml | 4 ++-- .../themes/smartwave_porto/recent_home_custom.phtml | 2 +- .../frontend/templates/widget/porto_theme_recent_home.phtml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/view/frontend/templates/post/list/item.phtml b/view/frontend/templates/post/list/item.phtml index 2359740b..f965df1e 100644 --- a/view/frontend/templates/post/list/item.phtml +++ b/view/frontend/templates/post/list/item.phtml @@ -16,7 +16,7 @@ getPost(); $_postUrl = $block->escapeUrl($_post->getPostUrl()); -$_postImage = $_post->getOgImage()? $_post->getOgImage() : $_post->getFeaturedImage(); +$_postImage = $_post->getFeaturedImg(); $_postName = $block->escapeHtml($_post->getTitle()); $imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); @@ -38,7 +38,7 @@ $imageWidth = (int)$block->getFeaturedImageWidth() ?: 722;