Posted on

Convert cms page content to html interpretation Magento 2

in my root.phtml, I can call for cms page content with :

<?php echo $layoutContent; ?>

but I wanted to use $cmsPage->getContent() instead :

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$cmsPage = $objectManager->get(‘MagentoCmsModelPage’);
echo $cmsPage->getContent();

I get this for result which is correct but not converting to html interpretation :

{{block class=”MagentoFrameworkViewElementTemplate” template=”Magento_Theme::cms/home.phtml”}}

Do you know if I could get it work ? ( toHtml() function return error )


Leave a Reply

Your email address will not be published.