First post on here, I've started developing a custom theme extending the blank theme and I'm just curious about making a module.

I've started on a module and I've made some blocks & templates, and it all works well, however I'm not sure if I've done everything right.

My module is 100% for the custom theme and nothing else, the module is in:


And I have my theme in:


Is this correct? Or should I have my module inside my theme? So it'd be like:


I think I'm doing everything right so far, however I'm not sure. I've named the theme & the module the same names (as the module will just provide everything for the theme and nothing else, so I figured this works the best).


1 Answer 1



Yeah what you've done is correct so far. For the styling:

Just think if someone else was to use your module, would they also want your styling?

If they would want your styling then also add that within app/code/VendorName_ModuleName. Otherwise it's better to NOT style the module within app/code and to style it within your theme.

  • Thank you! Okay great, I've done some styling in the module (just a layout.xml) however I've mostly done referenceContainers in there, which are defined in the themes XML. I'm assuming that's right? Thanks again.
    – Sledmore
    Oct 26, 2016 at 1:43
  • It comes down to whether your change ALWAYS needs to be made, if it's an XML change that your module depends on that it'll need to be in the modules XML, if it's a change that only needs to affect your theme then the theme's XML is the best place. If you will never be shipping your module to another theme/third party then technically it doesn't matter if it's in the module or the theme.
    – Ben Crook
    Oct 26, 2016 at 9:47

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.