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 ...

asked May 6, 2021 at 15:42

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!

answered May 7, 2021 at 3:43
4
  • My CMS homepage exist and i can see the content in backend. Why is not loaded in my frontend? Thanks Commented May 7, 2021 at 7:10
  • Check whether CMS homepage is assigned to any block Commented 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... Commented 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? Commented 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
answered May 7, 2021 at 4:22
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 Commented 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 :)

Mohit Patel
4,0484 gold badges27 silver badges57 bronze badges
answered May 7, 2021 at 13:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.