Skip to content

Commit

Permalink
Merge pull request #374 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
2.4 develop
  • Loading branch information
chuccv authored Nov 14, 2024
2 parents c2f0e4f + ad81e84 commit b9a5ed1
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 69 deletions.
35 changes: 35 additions & 0 deletions view/frontend/layout/hyva_catalog_product_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<!--
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://www.mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_Blog
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="Mageplaza_Blog::js/splide.min.js" />
<css src="Mageplaza_Blog::css/splide.min.css" />
</head>
<body>
<referenceBlock name="related.post.tab" >
<action method="setTemplate">
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/post/relatedpost.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
56 changes: 0 additions & 56 deletions view/frontend/layout/hyva_default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,70 +21,14 @@
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="Mageplaza_Blog::js/ckeditor.js" />
<script src="Mageplaza_Blog::js/splide.min.js" />
<css src="Mageplaza_Blog::css/splide.min.css" />

<script src="Mageplaza_Blog::js/treeselectjs.umd.js" />
<css src="Mageplaza_Blog::css/treeselectjs.css" />
</head>
<update handle="hyva_form_validation"/>
<body>
<referenceBlock name="mpblog.sidebar.category">
<action method="setTemplate">
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/category/widget.phtml</argument>
</action>
</referenceBlock>

<referenceBlock name="mpblog.design">
<action method="setTemplate">
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/design.phtml</argument>
</action>
</referenceBlock>

<referenceBlock name="mpblog.sidebar.search" >
<action method="setTemplate" ifconfig="blog/sidebar/search/enable_search">
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/sidebar/search.phtml</argument>
</action>
</referenceBlock>


<referenceBlock name="mpblog.sidebar.mostview" >
<action method="setTemplate">
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/sidebar/mostview.phtml</argument>
</action>
</referenceBlock>


<referenceBlock name="mpblog.post.view" >
<action method="setTemplate" >
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/post/view.phtml</argument>
</action>
</referenceBlock>


<referenceBlock name="footer-static-links">
<action method="setTemplate">
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/html/footer/links.phtml</argument>
</action>
<block class="Mageplaza\Blog\Block\Html\Footer" name="mp_blog_footer_link" template="Mageplaza_Blog::hyva/html/footer.phtml" after="-" ifconfig="blog/general/enabled"/>
</referenceBlock>

<referenceBlock name="related.category.products">
<action method="setTemplate" >
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/product/list.phtml</argument>
</action>
</referenceBlock>


<referenceBlock name="related.post.tab" >
<action method="setTemplate">
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/post/relatedpost.phtml</argument>
</action>
</referenceBlock>


</body>
</page>

12 changes: 12 additions & 0 deletions view/frontend/layout/hyva_mpblog_author.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,20 @@
<css src="Mageplaza_Core::css/font-awesome.min.css"/>
<css src="Mageplaza_Blog::css/hyvaManagePost.css"/>
<css src="Mageplaza_Blog::css/hyvaBlog.css"/>

<script src="Mageplaza_Blog::js/ckeditor.js" />

<script src="Mageplaza_Blog::js/treeselectjs.umd.js" />
<css src="Mageplaza_Blog::css/treeselectjs.css" />
</head>
<update handle="hyva_form_validation"/>

<body>
<referenceBlock name="mpblog.design">
<action method="setTemplate">
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/design.phtml</argument>
</action>
</referenceBlock>

</body>
</page>
17 changes: 12 additions & 5 deletions view/frontend/layout/hyva_mpblog_design.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,30 @@
<head>
<css src="Mageplaza_Core::css/grid-mageplaza.css"/>
<css src="Mageplaza_Core::css/font-awesome.min.css"/>
<css src="Mageplaza_Core::css/owl.carousel.css"/>
<css src="Mageplaza_Core::css/owl.theme.css"/>
<css src="Mageplaza_Blog::css/hyvaBlog.css"/>

<script src="Mageplaza_Blog::js/splide.min.js" />
<css src="Mageplaza_Blog::css/splide.min.css" />
</head>
<body>
<referenceContainer name="columns">
<container name="div.sidebar.main" htmlTag="div" htmlClass="sidebar sidebar-main" before="main">
<container name="blog.sidebar.main" as="sidebar_main" label="Sidebar Main">
<block class="Mageplaza\Blog\Block\Sidebar\Search" name="mpblog.sidebar.search" template="Mageplaza_Blog::sidebar/search.phtml" ifconfig="blog/sidebar/search/enable_search"/>
<block class="Mageplaza\Blog\Block\Sidebar\MostView" name="mpblog.sidebar.mostview" template="Mageplaza_Blog::sidebar/mostview.phtml" ifconfig="blog/sidebar/recent_post/enable_widget"/>
<block class="Mageplaza\Blog\Block\Category\Widget" name="mpblog.sidebar.category" template="Mageplaza_Blog::category/widget.phtml"/>
<block class="Mageplaza\Blog\Block\Sidebar\Search" name="mpblog.sidebar.search" template="Mageplaza_Blog::hyva/sidebar/search.phtml" ifconfig="blog/sidebar/search/enable_search"/>
<block class="Mageplaza\Blog\Block\Sidebar\MostView" name="mpblog.sidebar.mostview" template="Mageplaza_Blog::hyva/sidebar/mostview.phtml" ifconfig="blog/sidebar/recent_post/enable_widget"/>
<block class="Mageplaza\Blog\Block\Category\Widget" name="mpblog.sidebar.category" template="Mageplaza_Blog::hyva/category/widget.phtml"/>
<block class="Mageplaza\Blog\Block\MonthlyArchive\Widget" name="mpblog.sidebar.monthly" template="Mageplaza_Blog::monthly/widget.phtml"/>
<block class="Mageplaza\Blog\Block\Topic\Widget" name="mpblog.sidebar.topic" template="Mageplaza_Blog::topic/widget.phtml"/>
<block class="Mageplaza\Blog\Block\Tag\Widget" name="mpblog.sidebar.tag" template="Mageplaza_Blog::tag/widget.phtml"/>
</container>
</container>
</referenceContainer>

<referenceBlock name="mpblog.design">
<action method="setTemplate">
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/design.phtml</argument>
</action>
</referenceBlock>

</body>
</page>
37 changes: 37 additions & 0 deletions view/frontend/layout/hyva_mpblog_post_preview.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!--
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://www.mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_Blog
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="mpblog.post.view" >
<action method="setTemplate" >
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/post/view.phtml</argument>
</action>
</referenceBlock>

<referenceBlock name="related.category.products">
<action method="setTemplate" >
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/product/list.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
37 changes: 37 additions & 0 deletions view/frontend/layout/hyva_mpblog_post_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!--
/**
* Mageplaza
*
* NOTICE OF LICENSE
*
* This source file is subject to the Mageplaza.com license that is
* available through the world-wide-web at this URL:
* https://www.mageplaza.com/LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this extension to newer
* version in the future.
*
* @category Mageplaza
* @package Mageplaza_Blog
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/)
* @license https://www.mageplaza.com/LICENSE.txt
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="mpblog.post.view" >
<action method="setTemplate" >
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/post/view.phtml</argument>
</action>
</referenceBlock>

<referenceBlock name="related.category.products">
<action method="setTemplate" >
<argument name="template" xsi:type="string">Mageplaza_Blog::hyva/product/list.phtml</argument>
</action>
</referenceBlock>
</body>
</page>
21 changes: 13 additions & 8 deletions view/frontend/templates/hyva/post/author_post.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ HTML
</div>
<div class="post-info-action" data-postId="<?= $escaper->escapeHtml($post->getId()); ?>">
<div class="mpblog-post-duplicate"
onclick='handleDuplicate(this,<?= /** @noEscape */ json_encode($post->getData()) ?>)'
onclick='handleDuplicate(this,<?= /** @noEscape */ $post->getId() ?>, "<?= /** @noEscape */ $post->getImage() ?>")'
>
<img
src="<?= $escaper->escapeUrl($block->getViewFileUrl('Mageplaza_Blog::media/images/duplicate.svg')) ?>"
Expand All @@ -129,7 +129,8 @@ HTML
/>
</div>
<div class="mpblog-post-edit"
onclick='handleEdit(this,<?= /** @noEscape */ json_encode($post->getData()) ?>)'>
onclick='handleEdit(this,<?= /** @noEscape */ $post->getId() ?>, "<?= /** @noEscape */ $post->getImage() ?>")'
>
<img src="<?= $escaper->escapeUrl($block->getViewFileUrl('Mageplaza_Blog::media/images/writing.svg')) ?>"
align="middle"
alt="<?= $escaper->escapeHtmlAttr(__('Edit')); ?>"
Expand Down Expand Up @@ -203,10 +204,10 @@ HTML
openDialogNewPost();
}
// open modal edit new post
function handleEdit (e, data) {
function handleEdit (e, post_id, image) {
resetFormModal();
let listData = <?php echo /** @noEscape */ json_decode($jsonData) ?>;
let dataSelect = listData[data?.post_id];
let dataSelect = listData[post_id];
name.value = dataSelect?.name;
post_id.value = dataSelect?.post_id;
short_description.value = dataSelect?.short_description;
Expand All @@ -217,16 +218,16 @@ HTML

treeselectTags.updateValue(dataSelect?.tag_ids);
treeselectTopics.updateValue(dataSelect?.topic_ids);
addPreviewImg(data?.image);
addPreviewImg(image);

title.innerText = 'Edit Post';
openDialogNewPost()
}
// open modal duplicate new post
function handleDuplicate (e, data) {
function handleDuplicate (e, post_id, image) {
resetFormModal();
let listData = <?php echo /** @noEscape */ json_decode($jsonData) ?>;
let dataSelect = listData[data?.post_id];
let dataSelect = listData[post_id];
name.value = dataSelect?.name;
short_description.value = dataSelect?.short_description;
editor.setData(dataSelect?.post_content ?? "");
Expand All @@ -235,7 +236,7 @@ HTML
treeselectCategories.updateValue(dataSelect?.category_ids);
treeselectTags.updateValue(dataSelect?.tag_ids);
treeselectTopics.updateValue(dataSelect?.topic_ids);
addPreviewImg(data?.image);
addPreviewImg(image);
title.innerText = 'Duplicate Post';
openDialogNewPost()
}
Expand All @@ -254,6 +255,10 @@ HTML
if (element) {
element.parentNode.removeChild(element);
}
let messagesError = document.querySelectorAll('#mp-blog-new-post-popup form .messages');
messagesError.forEach(mess => {
mess.remove()
})
}
// add preview image when open modal edit and duplicate modal
function addPreviewImg (value) {
Expand Down

0 comments on commit b9a5ed1

Please sign in to comment.