/** * Retrieve post content * * @return string */ public function getContent() { $category = $this->getCategory(); $key = 'filtered_content'; if (!$category->hasData($key)) { $cotent = $this->_filterProvider->getPageFilter()->filter($category->getContent()); $category->setData($key, $cotent); } return $category->getData($key); }
/** * Prepare Content HTML * * @return string */ protected function _toHtml() { $blockId = $this->getBlockId(); $html = ''; if ($blockId) { $storeId = $this->_storeManager->getStore()->getId(); /** @var \Magento\Cms\Model\Block $block */ $block = $this->_blockFactory->create(); $block->setStoreId($storeId)->load($blockId); if ($block->isActive()) { $html = $this->_filterProvider->getBlockFilter()->setStoreId($storeId)->filter($block->getContent()); } } return $html; }
/** * {@inheritdoc} */ public function getSearchableEntities($storeId, $entityIds = null, $lastEntityId = null, $limit = 100) { $collection = $this->collectionFactory->create()->addStoreFilter($storeId)->addFieldToFilter('is_active', 1); $ignored = $this->getModel()->getProperty('ignored_pages'); if (is_array($ignored) && count($ignored)) { $collection->addFieldToFilter('identifier', ['nin' => $ignored]); } if ($entityIds) { $collection->addFieldToFilter('page_id', $entityIds); } $collection->addFieldToFilter('page_id', ['gt' => $lastEntityId])->setPageSize($limit)->setOrder('page_id'); $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); try { /** @var \Magento\Store\Model\App\Emulation $emulation */ $emulation = $objectManager->create('Magento\\Store\\Model\\App\\Emulation'); $emulation->startEnvironmentEmulation($storeId, true); /** @var \Magento\Cms\Model\Page $page */ foreach ($collection as $page) { $template = $this->emailTemplateFactory->create(); $template->emulateDesign($storeId); $template->setTemplateText($page->getContent())->setIsPlain(false); $template->setTemplateFilter($this->cmsFilterProvider->getPageFilter()); $html = $template->getProcessedTemplate([]); $page->setContent($page->getContent() . $html); } $emulation->stopEnvironmentEmulation(); } catch (\Exception $e) { } return $collection; }
/** * @param $img * @return string */ public function getImgHtml($img) { $img = $this->postHelper->getPhotoUrl($img); $html = ''; if ($img != "") { $html = '<div class="post_photo"> <img src="' . $this->filterProvider->getPageFilter()->filter($img) . '" /> </div>'; } return $html; }
/** * Retrieve post content * * @return string */ public function getContent() { $post = $this->getPost(); $key = 'filtered_content'; if (!$post->hasData($key)) { $cotent = $this->_filterProvider->getPageFilter()->filter($post->getContent()); $post->setData($key, $cotent); } return $post->getData($key); }
/** * Prepare block text and determine whether block output enabled or not * Prevent blocks recursion if needed * * @return $this */ protected function _beforeToHtml() { parent::_beforeToHtml(); $blockId = $this->getData('block_id'); $blockHash = get_class($this) . $blockId; if (isset(self::$_widgetUsageMap[$blockHash])) { return $this; } self::$_widgetUsageMap[$blockHash] = true; if ($blockId) { $storeId = $this->_storeManager->getStore()->getId(); /** @var \Magento\Cms\Model\Block $block */ $block = $this->_blockFactory->create(); $block->setStoreId($storeId)->load($blockId); if ($block->isActive()) { $this->setText($this->_filterProvider->getBlockFilter()->setStoreId($storeId)->filter($block->getContent())); } } unset(self::$_widgetUsageMap[$blockHash]); return $this; }
/** * Prepare HTML content * * @return string */ protected function _toHtml() { $html = $this->_filterProvider->getPageFilter()->filter($this->getPage()->getContent()); $html = $this->getLayout()->renderElement('messages') . $html; return $html; }
/** * Prepare HTML content * * @return string */ protected function _toHtml() { $html = $this->_filterProvider->getPageFilter()->filter($this->getPage()->getContent()); return $html; }
/** * Retrieve post content * * @return string */ public function getContent() { return $this->_filterProvider->getPageFilter()->filter($this->getPost()->getContent()); return $this->getData($k); }
protected function _toHtml() { $storeId = $this->_storeManager->getStore()->getId(); $html = $this->filterProvider->getBlockFilter()->setStoreId($storeId)->filter($this->getWidgetContent()); return $html; }
public function filter($str) { $html = $this->_filterProvider->getPageFilter()->filter($str); return $html; }
/** * @covers \Magento\Cms\Model\Template\FilterProvider::getPageFilter */ public function testGetPageFilterInnerCache() { $this->_objectManagerMock->expects($this->once())->method('get')->will($this->returnValue($this->_filterMock)); $this->_model->getPageFilter(); $this->_model->getPageFilter(); }
/** * @return string */ public function getPostContent() { return $this->filterProvider->getPageFilter()->filter($this->getPost()->getShortContent() . $this->getPost()->getContent()); }