0

In my server with: elasticsearch7, apache 2.4.29, mariaDB 10.4 and php 7.4 I imported my Magento 2.4.2 site. Everything works correctly except for the CMS pages that have empty content and in fact the #maincontent div is empty.

I am attaching a screenshot of the problem: enter image description here Content is empty but without errors of php

I've looked at the log files but they don't return any errors. Why?

It's like Magento doesn't load the CMS page object ...

3 Answers 3

0

If you have experience with SQL you can check the database table and

select * from cms_page where identifier = 'your-page';

You can also check if the page layout was not overwritten. Look for files cms_index_index_your-page.xml

Finally you can debug the controller:

vendor/magento/module-cms/Controller/Index/Index.php

Good luck!

4
  • My CMS homepage exist and i can see the content in backend. Why is not loaded in my frontend? Thanks
    – Jackom
    May 7, 2021 at 7:10
  • Check whether CMS homepage is assigned to any block May 7, 2021 at 7:13
  • The CMS homepage is assigned correctly from backend of Magento2. This issue is on every CMS page. I can see blocks but not the content of CMS pages...
    – Jackom
    May 7, 2021 at 7:35
  • Did you look over for customizations on cms_index_index.xml? Further that, do you have more store views that you could assign wrongly. Could you share the common configurations of the page? May 7, 2021 at 13:02
0

You have to install Sample Data in your magento project

Go to your Magento Root and run the following command

bin/magento sampledata:deploy

After installing Sample Data run setup upgrade command and then clear cache

bin/magento setup:upgrade
bin/magento cache:clean
1
  • I don't want install sample data because i have my custom content in my cms homepage. For you why i can not see his content in frontend? thx
    – Jackom
    May 7, 2021 at 7:11
0

I FOUND THE SOLUTION!!

The issue is when cms_page_view.xml is missing!

So i added cms_page_view.xml to /vendor/magento/module-cms/view/frontend/layout

and works like a charm!

I hope it serves someone else :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.