diff --git a/Block/Adminhtml/System/Config/Head.php b/Block/Adminhtml/System/Config/Head.php index 700edf97..6d726e7f 100755 --- a/Block/Adminhtml/System/Config/Head.php +++ b/Block/Adminhtml/System/Config/Head.php @@ -42,8 +42,8 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele { // $html='
  • // -// * User Guide
    -// * Report a problem
    +// * User Guide
    +// * Report a problem
    // * Your default blog URL domain.com/blog/
    // * Atom Feed domain.com/blog/post/rss/
    // * Sitemap domain.com/sitemap/blog.xml
    diff --git a/Block/Sidebar/Mostview.php b/Block/Sidebar/Mostview.php index edc9d38c..eda0b02a 100755 --- a/Block/Sidebar/Mostview.php +++ b/Block/Sidebar/Mostview.php @@ -42,12 +42,13 @@ public function getLimitPost() public function getRecentPost() { - $ob = $this->objectManager->get('Mageplaza\Blog\Model\Post'); + $ob = $this->objectManager->get('Mageplaza\Blog\Model\Post'); $posts = $ob->getCollection(); $posts->setOrder('created_at', 'DESC'); return $posts; } + public function getLimitRecentPost() { return $this->helperData->getBlogConfig('sidebar/number_recent_posts'); diff --git a/Model/Config/Source/Backend/Image.php b/Model/Config/Source/Backend/Image.php new file mode 100644 index 00000000..00d6fc89 --- /dev/null +++ b/Model/Config/Source/Backend/Image.php @@ -0,0 +1,41 @@ +_mediaDirectory->getAbsolutePath($this->_appendScopeInfo(self::UPLOAD_DIR)); + } + + /** + * Makes a decision about whether to add info about the scope. + * + * @return boolean + */ + protected function _addWhetherScopeInfo() + { + return true; + } + + /** + * Getter for allowed extensions of uploaded files. + * + * @return string[] + */ + protected function _getAllowedExtensions() + { + return ['jpg', 'jpeg', 'gif', 'png', 'svg']; + } +} \ No newline at end of file diff --git a/Model/ResourceModel/Category.php b/Model/ResourceModel/Category.php index d9894ff0..c9c9f58e 100755 --- a/Model/ResourceModel/Category.php +++ b/Model/ResourceModel/Category.php @@ -91,9 +91,9 @@ public function getCategoryNameById($id) */ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object) { - $object->setUpdatedAt($this->date->date('Y-m-d')); + $object->setUpdatedAt($this->date->date()); if ($object->isObjectNew()) { - $object->setCreatedAt($this->date->date('Y-m-d')); + $object->setCreatedAt($this->date->date()); } /** @var \Mageplaza\Blog\Model\Category $object */ parent::_beforeSave($object); diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 33e3c383..a446e21b 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -31,82 +31,88 @@ showInWebsite="1" showInStore="1"> Magento\Config\Model\Config\Source\Yesno + Enable/Disable Blog module - Blog name + Learn more.]]> - + + blog, news or what you want. It should be lower case. ]]> + - - Leave empty for no suffix. Default: html + + .html ]]> + Magento\Config\Model\Config\Source\Yesno + Deprecated function. ]]> + Magento\Config\Model\Config\Source\Yesno + learn more. ]]> - + Magento\Config\Model\Config\Source\Yesno + + - + Magento\Config\Model\Config\Source\Yesno + + - + Mageplaza\Blog\Model\Config\Source\Blogview\Display - Grid view style is better + You can display blog posts in Grid/List mode Magento\Config\Model\Config\Source\Yesno - If you already had bootstrap css library, then select no. + BoostrapCSS, so select No ]]> + - - Type color code. Eg: #1abc9c, #1979c3... - - - - Magento\Config\Model\Config\Source\Yesno - If your choose Yes, Author name, avatar and author description will be display in blog - - - - Author name in your blog - - - - Mageplaza\Blog\Model\Config\Source\Backend\Image - mageplaza/author - Author avatar in your blog - - - - This field is required if you choose Yes at Display author in blog - + + + + + + + + + + + + + + + + - + @@ -115,7 +121,7 @@ - + - + Mageplaza\Blog\Model\Config\Source\Comments\Type + You can switch Disqus comment or Facebook Comment. - Disqus]]> + Disqus.]]> 3 - here]]> + here]]> 2 - + - + - + - + - + Magento\Config\Model\Config\Source\Yesno + Learn more]]> - + + here]]> diff --git a/etc/config.xml b/etc/config.xml index 7cd6c9fe..38b874bb 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -1,17 +1,17 @@ - + + + 1 Blog blog - .html + 1 1 - #1abc9c - 1 - admin + + 0 5 diff --git a/view/adminhtml/templates/system/config/head.phtml b/view/adminhtml/templates/system/config/head.phtml index 8f7b29da..24f22514 100755 --- a/view/adminhtml/templates/system/config/head.phtml +++ b/view/adminhtml/templates/system/config/head.phtml @@ -1,17 +1,9 @@ \ No newline at end of file diff --git a/view/frontend/layout/blog_category_index.xml b/view/frontend/layout/blog_category_index.xml index f3807d79..ba2183be 100755 --- a/view/frontend/layout/blog_category_index.xml +++ b/view/frontend/layout/blog_category_index.xml @@ -8,6 +8,14 @@ + + + + + -
    + +
    + getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('mageplaza_blog_view_above_comment')->toHtml();?> +
    + + +
    checkComment(); ?>
    @@ -144,7 +154,7 @@
    -
    +

    diff --git a/view/frontend/templates/sidebar/mostview.phtml b/view/frontend/templates/sidebar/mostview.phtml index 784c42ba..337eb3d6 100755 --- a/view/frontend/templates/sidebar/mostview.phtml +++ b/view/frontend/templates/sidebar/mostview.phtml @@ -2,6 +2,11 @@ $posts = $block->getMosviewPosts(); $postsRecent = $block->getRecentPost(); ?> + +
    + getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('mageplaza_blog_sidebar_above_popular_widget')->toHtml();?> +
    +