11<?php
22/**
3- * Copyright © 2015 Ihor Vansach ([email protected] ). All rights reserved. 3+ * Copyright © 2015-2017 Ihor Vansach ([email protected] ). All rights reserved. 44 * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
55 *
66 * Glory to Ukraine! Glory to the heroes!
@@ -26,16 +26,16 @@ class Comments extends \Magento\Framework\View\Element\Template
2626 protected $ _coreRegistry ;
2727
2828 /**
29- * Construct
30- *
31- * @param \Magento\Framework\View\Element\Context $context
32- * @param \Magento\Framework\Registry $coreRegistry,
33- * @param \Magento\Cms\Model\Page $post
34- * @param \Magento\Framework\Registry $coreRegistry,
35- * @param \Magento\Cms\Model\ Template\FilterProvider $filterProvider
36- * @param \Magento\Store\Model\StoreManagerInterface $storeManager
37- * @param \Magento\Cms\Model\PageFactory $postFactory
38- * @param array $data
29+ * @var string
30+ */
31+ protected $ commetType ;
32+
33+ /**
34+ * Constructor
35+ * @param \Magento\Framework\View\Element\ Template\Context $context
36+ * @param \Magento\Framework\Registry $coreRegistry
37+ * @param \Magento\Framework\Locale\ResolverInterface $localeResolver
38+ * @param array $data
3939 */
4040 public function __construct (
4141 \Magento \Framework \View \Element \Template \Context $ context ,
@@ -121,4 +121,18 @@ public function getPost()
121121 }
122122 return $ this ->getData ('post ' );
123123 }
124+
125+ /**
126+ * Render block HTML
127+ *
128+ * @return string
129+ */
130+ protected function _toHtml ()
131+ {
132+ if ($ this ->commetType && $ this ->commetType != $ this ->getCommentsType ()) {
133+ return '' ;
134+ }
135+
136+ return parent ::_toHtml ();
137+ }
124138}
0 commit comments