1

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:

app/code/VendorName_ModuleName

And I have my theme in:

app/design/frontend/VendorName_ModuleName

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

app/design/frontend/VendorName_ModuleName/VendorName_ModuleName

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

Thanks

asked Oct 25, 2016 at 16:18

1 Answer 1

0

Welcome!

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.

answered Oct 25, 2016 at 16:48
2
  • 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. Commented 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. Commented Oct 26, 2016 at 9:47

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.