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
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!
-
My CMS homepage exist and i can see the content in backend. Why is not loaded in my frontend? ThanksJackom– Jackom2021年05月07日 07:10:57 +00:00Commented May 7, 2021 at 7:10
-
Check whether CMS homepage is assigned to any blockArun Kumar– Arun Kumar2021年05月07日 07:13:26 +00:00Commented 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– Jackom2021年05月07日 07:35:27 +00:00Commented 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?viniciusbord9– viniciusbord92021年05月07日 13:02:01 +00:00Commented May 7, 2021 at 13:02
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
-
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? thxJackom– Jackom2021年05月07日 07:11:58 +00:00Commented May 7, 2021 at 7:11
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 :)