Skip to content

Commit 0ac258a

Browse files
authored
Merge pull request #372 from mageplaza/2.4-develop
2.4 develop
2 parents 4f75da5 + 882c315 commit 0ac258a

File tree

13 files changed

+230
-31
lines changed

13 files changed

+230
-31
lines changed

Block/Widget/Posts.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,17 @@ public function getBlogUrl($code)
8282
{
8383
return $this->helperData->getBlogUrl($code);
8484
}
85+
86+
/**
87+
* Render block HTML
88+
*
89+
* @return string
90+
*/
91+
protected function _toHtml()
92+
{
93+
if ($this->helperData->checkHyvaTheme()) {
94+
$this->setTemplate('Mageplaza_Blog::hyva/widget/posts.phtml');
95+
}
96+
return parent::_toHtml();
97+
}
8598
}

Plugin/HyvaMenu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function afterGetNavigation(
7979
"is_category" => true,
8080
"is_parent_active" => true,
8181
"position" => null,
82-
"path" => "1/2/38" . $key,
82+
"path" => $category->getPath(),
8383
"childData" => $blockMenu->getChildDataCate($category)
8484
];
8585
array_push($childData, $data);
@@ -95,7 +95,7 @@ public function afterGetNavigation(
9595
"is_category" => true,
9696
"is_parent_active" => true,
9797
"position" => null,
98-
"path" => "1/2/39",
98+
"path" => $blockMenu->getPath(),
9999
"childData" => $childData
100100
];
101101
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"mageplaza/facebook-graph-sdk": "^1.0.1"
77
},
88
"type": "magento2-module",
9-
"version": "4.2.4",
9+
"version": "4.2.5",
1010
"license": "proprietary",
1111
"keywords": [
1212
"magento 2",

view/frontend/layout/hyva_default.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@
6363
</action>
6464
</referenceBlock>
6565

66-
<referenceBlock name="footer-content">
67-
<block class="Mageplaza\Blog\Block\Html\Footer" name="mp_blog_footer_link" template="Mageplaza_Blog::hyva/html/footer.phtml" after="-"/>
66+
67+
<referenceBlock name="footer-static-links">
68+
<action method="setTemplate">
69+
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/html/footer/links.phtml</argument>
70+
</action>
71+
<block class="Mageplaza\Blog\Block\Html\Footer" name="mp_blog_footer_link" template="Mageplaza_Blog::hyva/html/footer.phtml" after="-" ifconfig="blog/general/enabled"/>
6872
</referenceBlock>
6973

7074
<referenceBlock name="related.category.products">

view/frontend/templates/hyva/design.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use Magento\Framework\Escaper;
3737
columns.removeChild(sidebarMain);
3838
}
3939
}
40-
var currentTheme = "<?php echo $block->getCurrentTheme(); ?>";
40+
var currentTheme = "<?php echo /** @noEscape */ $block->getCurrentTheme() ?>";
4141
if (currentTheme === "Etheme/yourstore") {
4242
body.classList.add('mpblog-etheme-yourstore');
4343
}

view/frontend/templates/hyva/html/footer.phtml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,12 @@ $helper = $block->getHelperData();
2828
?>
2929
<?php if ($helper->isEnabled()) : ?>
3030
<?php if ($helper->getBlogConfig('display/footer')) : ?>
31-
<div class="pr-4 lg:w-1/4 md:w-1/2">
32-
<ul>
33-
<li>
34-
<a class="text-base leading-6" <?= /** @noEscape */ $block->getLinkAttributes() ?>>
35-
<?= $escaper->escapeHtml($block->getLabel()); ?>
36-
<?= ($block->getCounter()) ? '<span>' . $escaper->escapeHtml($block->getCounter()) . '</span>' : ''; ?>
37-
</a>
38-
</li>
39-
</ul>
40-
</div>
31+
<li class="mt-4">
32+
<a class="text-base leading-6" <?= /** @noEscape */
33+
$block->getLinkAttributes() ?>>
34+
<?= $escaper->escapeHtml($block->getLabel()); ?>
35+
<?= ($block->getCounter()) ? '<span>' . $escaper->escapeHtml($block->getCounter()) . '</span>' : ''; ?>
36+
</a>
37+
</li>
4138
<?php endif; ?>
42-
<?= $block->getChildHtml('mp_blog_footer_add') ?>
4339
<?php endif; ?>
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?php
2+
/**
3+
* Hyvä Themes - https://hyva.io
4+
* Copyright © Hyvä Themes 2020-present. All rights reserved.
5+
* This product is licensed per Magento install
6+
* See https://hyva.io/license
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
use Hyva\Theme\Model\ViewModelRegistry;
12+
use Hyva\Theme\ViewModel\Customer;
13+
use Hyva\Theme\ViewModel\StoreConfig;
14+
use Magento\Framework\Escaper;
15+
use Magento\Framework\View\Element\Template;
16+
17+
/** @var Template $block */
18+
/** @var Escaper $escaper */
19+
/** @var ViewModelRegistry $viewModels */
20+
21+
/** @var Customer $customer */
22+
$customer = $viewModels->require(Customer::class);
23+
/** @var StoreConfig $storeConfig */
24+
$storeConfig = $viewModels->require(StoreConfig::class);
25+
?>
26+
<div class="md:w-1/2 w-full flex flex-wrap pr-4">
27+
<div class="w-full grid grid-cols-1 sm:grid-cols-2 gap-8 xl:col-span-2">
28+
<div>
29+
<h2 class="text-md leading-5 font-semibold tracking-wider uppercase">
30+
Company
31+
</h2>
32+
<ul class="mt-4">
33+
<li>
34+
<a href="#" class="text-base leading-6">
35+
About
36+
</a>
37+
</li>
38+
<li class="mt-4">
39+
<a href="<?= $escaper->escapeUrl($block->getUrl('customer/account')) ?>"
40+
class="text-base leading-6">
41+
<?= $escaper->escapeHtml(__('My Account')) ?>
42+
</a>
43+
</li>
44+
<?php if (!$customer->customerLoggedIn()): ?>
45+
<li class="mt-4">
46+
<a href="<?= $escaper->escapeUrl($block->getUrl('sales/guest/form')) ?>"
47+
class="text-base leading-6">
48+
<?= $escaper->escapeHtml(__('Orders and Returns')) ?>
49+
</a>
50+
</li>
51+
<?php endif; ?>
52+
<?php if ($storeConfig->getStoreConfig('catalog/seo/search_terms')): ?>
53+
<li class="mt-4">
54+
<a href="<?= $escaper->escapeUrl($block->getUrl('search/term/popular')) ?>"
55+
class="text-base leading-6">
56+
<?= $escaper->escapeHtml(__('Search Terms')) ?>
57+
</a>
58+
</li>
59+
<?php endif; ?>
60+
<li class="mt-4 mb-4">
61+
<a href="<?= $escaper->escapeUrl($block->getUrl('contact')) ?>"
62+
class="text-base leading-6">
63+
<?= $escaper->escapeHtml(__('Contact')) ?>
64+
</a>
65+
</li>
66+
<?= $block->getChildHtml() ?>
67+
</ul>
68+
</div>
69+
<div>
70+
<h2 class="text-md leading-5 font-semibold tracking-wider uppercase">
71+
Legal
72+
</h2>
73+
<ul class="mt-4">
74+
<li class="mt-4">
75+
<a href="#" class="text-base leading-6">
76+
Privacy
77+
</a>
78+
</li>
79+
<li class="mt-4">
80+
<a href="#" class="text-base leading-6">
81+
Terms and Conditions
82+
</a>
83+
</li>
84+
</ul>
85+
</div>
86+
</div>
87+
</div>

view/frontend/templates/hyva/post/author_post.phtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ $jsonData = json_encode($postDatas);
5454
class="action primary btn btn-primary" title="<?= $escaper->escapeHtmlAttr(__('Add New Post')) ?>">
5555
<?= $escaper->escapeHtml(__('Add New Post')) ?>
5656
</button>
57-
<?= $modalViewModel->createModal()
57+
<?= /** @noEscape */ $modalViewModel->createModal()
5858
->addDialogClass('overflow-y-hidden overflow-x-hidden fixed z-50 justify-center items-center w-3/4 md:inset-0 h-4/5')
5959
->removeDialogClass('p-10')
6060
->withDialogRefName("add-new-post-name")
@@ -119,7 +119,7 @@ HTML
119119
</div>
120120
<div class="post-info-action" data-postId="<?= $escaper->escapeHtml($post->getId()); ?>">
121121
<div class="mpblog-post-duplicate"
122-
onclick='handleDuplicate(this,<?= json_encode($post->getData()) ?>)'
122+
onclick='handleDuplicate(this,<?= /** @noEscape */ json_encode($post->getData()) ?>)'
123123
>
124124
<img
125125
src="<?= $escaper->escapeUrl($block->getViewFileUrl('Mageplaza_Blog::media/images/duplicate.svg')) ?>"
@@ -129,7 +129,7 @@ HTML
129129
/>
130130
</div>
131131
<div class="mpblog-post-edit"
132-
onclick='handleEdit(this,<?= json_encode($post->getData()) ?>)'>
132+
onclick='handleEdit(this,<?= /** @noEscape */ json_encode($post->getData()) ?>)'>
133133
<img src="<?= $escaper->escapeUrl($block->getViewFileUrl('Mageplaza_Blog::media/images/writing.svg')) ?>"
134134
align="middle"
135135
alt="<?= $escaper->escapeHtmlAttr(__('Edit')); ?>"
@@ -205,7 +205,7 @@ HTML
205205
// open modal edit new post
206206
function handleEdit (e, data) {
207207
resetFormModal();
208-
let listData = <?php echo json_decode($jsonData) ?>;
208+
let listData = <?php echo /** @noEscape */ json_decode($jsonData) ?>;
209209
let dataSelect = listData[data?.post_id];
210210
name.value = dataSelect?.name;
211211
post_id.value = dataSelect?.post_id;
@@ -225,7 +225,7 @@ HTML
225225
// open modal duplicate new post
226226
function handleDuplicate (e, data) {
227227
resetFormModal();
228-
let listData = <?php echo json_decode($jsonData) ?>;
228+
let listData = <?php echo /** @noEscape */ json_decode($jsonData) ?>;
229229
let dataSelect = listData[data?.post_id];
230230
name.value = dataSelect?.name;
231231
short_description.value = dataSelect?.short_description;

view/frontend/templates/hyva/post/manage_post.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ use Magento\Framework\Escaper;
210210
console.error(err.stack);
211211
});
212212

213-
const categories = <?php echo($block->getCategoriesTree()) ?>;
214-
const topics = <?php echo($block->getTopicTree()) ?>;
215-
const tags = <?php echo($block->getTagTree()) ?>;
213+
const categories = <?php echo /** @noEscape */ ($block->getCategoriesTree()) ?>;
214+
const topics = <?php echo /** @noEscape */ ($block->getTopicTree()) ?>;
215+
const tags = <?php echo /** @noEscape */ ($block->getTagTree()) ?>;
216216
const optionsCategories = categories?.map(data => {
217217
return {
218218
name: data?.label,

view/frontend/templates/hyva/post/relatedpost.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ if ($posts && $block->isEnabledBlog()) : ?>
6464
document.addEventListener('DOMContentLoaded', function () {
6565
new Splide('#relatedposts-carousel', {
6666
perPage: 3,
67+
gap: 15,
6768
breakpoints: {
6869
1028: {
6970
perPage: 2

0 commit comments

Comments
 (0)