0

I want my module controller to show content inside of store layout (eg show header, then my controller data, then footer, so it will look like being part of the store, not on a blank page). I created a block with template to achieve this, but I didn't made it working.

I wanted to be sure I did everything right, so I used mage2gen to make a test module

https://mage2gen.com/load/9e9a75ed-e70f-4438-87fc-fce992cc07a0

and I have the same results. When I open the controller url, store header and footer is shown, but the inner part is blank - everything inside template file is ignored. First I thought it's just not displayed, so I waited for the page to finish loading and then searched the for some text from the template in page source (developer tools -> elements), but it's not here. Like if the template was blank.

I runned magento setup:upgrade and cache:flush multiple times, but no changes. The var/log has nothing related in here (only debug.log is printing cache_invalidate as always)

What is wrong here? Did I messed up my store, or is mage2gen not working properly?

2
  • can you please enter template file code and location? Also did you run static-content:deploy command? Nov 10, 2017 at 20:46
  • You can see all the code if you visit the mage2gen link, in the right column you can click on them to see content. Runnin static-content:deploy causes an error: There are no commands defined in the "static-content" namespace. Did you mean this? setup:static-content I have store in developer mode, maybe it could be because of this? Nov 10, 2017 at 20:49

1 Answer 1

0

It seems like the issue is layout file name.

Please make it lower case and run all command again. Make sure to flush cache.

testmodulblock_index_index.xml

Let me know if it works.

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.