I have the following directory structure in the CMS application we have written:
/application
/modules
/cms
/filemanager
/block
/pages
/sitemap
/youtube
/rss
/skin
/backend
/default
/css
/js
/images
/frontend
/default
/css
/js
/images
Application contains code specific to the current CMS implementation, i.e code for this specific cms. Modules contain reusable portions of code that we share across projects, such as libraries to work with youtube or rss feeds. We include these as git submodules, so that we can update the module in any website and push the changes back across all other projects. It makes it really easy to apply a change to our code and distribute it. We wanted to turn the CMS into a module so we get the same benefit - we can run the entire project under source control, then update the cms as required through a git-submodule. We have run into a problem however: the cms requires javascript/images/css in order for it to work correctly.
Things we have thought about:
We could create 2 submodules, one for cms-skin and one for cms, but this means you cannot "git pull" one version without having some idea of which versions of skin work with which versions of cms. i.e version 1.2.2 CMS might have issues with 1.0.3 CMS-Skin
We could add the skin to the cms module but this has the following problems:
How is this typically done in large scale cms's? How is it possible to get the source code for a cms under version control, work on the application for a client, then update the sourcecode as releases and given by the vendor? How do applications like Magento or Drupal do this?
I am not familiar with CMS projects, but could you:
cms would be a "main project" for cms-skin, meaning each time you commit cms, you would have committed cms-skin first, and the "cms commit" would embark the exact SHA1 reference of the cms-skin used at the time of the commit.
That way you can pull only cms, and with it will come the exact version of cms-skin you need.
For more, see this SO answer about the true nature of submodules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With