homepage === null) { $homepage = $this->collectionFactory->create() ->setPageSize(1) ->getFirstItem(); $this->homepage = $homepage->getId() ? $homepage : $this->homepageFactory->create(); if (!$this->homepage->getData('title')) { $this->homepage->setData('title', 'eSUN Wiki'); } } return $this->homepage; } public function getSaveUrl(): string { return $this->getUrl('esun_wiki/homepage/save'); } public function getCategoriesUrl(): string { return $this->getUrl('esun_wiki/category/index'); } public function getPreviewUrl(): string { return rtrim($this->_storeManager->getStore()->getBaseUrl(UrlInterface::URL_TYPE_LINK), '/') . '/wiki'; } public function getContentEditorHtml(): string { $form = $this->formFactory->create(); $editor = $form->addField('content', 'editor', [ 'name' => 'content', 'label' => __('Homepage Content'), 'title' => __('Homepage Content'), 'style' => 'height:36em', 'required' => false, 'value' => (string) $this->getHomepage()->getData('content'), 'config' => $this->wysiwygConfig->getConfig([ 'add_variables' => false, 'add_widgets' => true, 'add_images' => true, 'is_pagebuilder_enabled' => true, 'pagebuilder_button' => true, ]), ]); return $editor->getElementHtml(); } }