From 17ff46c290e1b969f1fd26b217f6aaba8bd2b114 Mon Sep 17 00:00:00 2001 From: Andrey Golovin Date: Tue, 31 May 2016 13:36:55 +0300 Subject: [PATCH] AddThis template and configuration --- Block/Social/AddThis.php | 31 ++++++++++++++++++++++ etc/adminhtml/system.xml | 9 +++++++ etc/config.xml | 4 +++ view/frontend/layout/blog_post_list.xml | 2 ++ view/frontend/layout/blog_post_view.xml | 2 +- view/frontend/templates/addthis-js.phtml | 7 +++++ view/frontend/templates/post/list.phtml | 10 +------ view/frontend/templates/post/view/js.phtml | 22 --------------- 8 files changed, 55 insertions(+), 32 deletions(-) create mode 100644 Block/Social/AddThis.php create mode 100644 view/frontend/templates/addthis-js.phtml delete mode 100644 view/frontend/templates/post/view/js.phtml diff --git a/Block/Social/AddThis.php b/Block/Social/AddThis.php new file mode 100644 index 00000000..102e4ebc --- /dev/null +++ b/Block/Social/AddThis.php @@ -0,0 +1,31 @@ +_scopeConfig->getValue( + 'mfblog/social/add_this_pubid', ScopeInterface::SCOPE_STORE + ); + } + + public function getAddThisLanguage() + { + return $this->_scopeConfig->getValue( + 'mfblog/social/add_this_language', ScopeInterface::SCOPE_STORE + ); + } + + public function toHtml() + { + if (!$this->getAddThisPubId()) { + return ''; + } + + return parent::toHtml(); + } +} \ No newline at end of file diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 2e3e2efd..057d9068 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -266,6 +266,15 @@ E.g.: "search" will make the blog search accessible from mystore.com/{blog_route}/search/query/ + + + + + + + + + diff --git a/etc/config.xml b/etc/config.xml index 188734a5..b38422fc 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -71,6 +71,10 @@ author search + + ra-4def63cd3cf37569 + en + diff --git a/view/frontend/layout/blog_post_list.xml b/view/frontend/layout/blog_post_list.xml index 4f8f35a5..3d207896 100755 --- a/view/frontend/layout/blog_post_list.xml +++ b/view/frontend/layout/blog_post_list.xml @@ -30,6 +30,8 @@ post_list_toolbar + + diff --git a/view/frontend/layout/blog_post_view.xml b/view/frontend/layout/blog_post_view.xml index af300288..c04a0d43 100755 --- a/view/frontend/layout/blog_post_view.xml +++ b/view/frontend/layout/blog_post_view.xml @@ -21,7 +21,7 @@ - + diff --git a/view/frontend/templates/addthis-js.phtml b/view/frontend/templates/addthis-js.phtml new file mode 100644 index 00000000..0065a810 --- /dev/null +++ b/view/frontend/templates/addthis-js.phtml @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/view/frontend/templates/post/list.phtml b/view/frontend/templates/post/list.phtml index 018633b0..56d9f54e 100755 --- a/view/frontend/templates/post/list.phtml +++ b/view/frontend/templates/post/list.phtml @@ -37,13 +37,5 @@ $_postCollection = $block->getPostCollection(); getToolbarHtml() ?> - - - - + getChildHtml('addthisJs'); ?> diff --git a/view/frontend/templates/post/view/js.phtml b/view/frontend/templates/post/view/js.phtml deleted file mode 100644 index 8348e5b3..00000000 --- a/view/frontend/templates/post/view/js.phtml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file