Skip to content

Handling multiple modules

colinmollenhour edited this page Feb 19, 2012 · 1 revision

Modman allows you to use more than one module in the same application root, so you may choose to put third party code or templates in separate repositories, etc.. Modman has two methods of facilitating multiple modules, either or both of which may be used as needed.

Separate working directories

You can install multiple modules by simply running modman <clone|checkout|link> [<modulename>] <url> for each module. The explicitly named <module> is optional, similar to how git and svn work, but if order matters you may want to specify names as modman <update-all|deploy-all> will update or deploy all modules in alphabetical (ls) order.

Nested Modules (@import)

Modman also supports nested modules. Using nested modules allows you to have fewer working copies checked out if the source for your modules is all contained within one repository but you wish to keep them more modularized in your repository. You could also use nested modules with svn:externals or git submodules to include an external module into your working copy. The nested modules share the same deploy root as the parent module. In your parent module's modman file specify the root of the nested module using @import like so:

File stored in your repo at themes/my/modman:

# My template
skin               skin/frontend/my/default
design             app/design/frontend/my/default

The modman file at the root of your repo:

@import            themes/my
@import            third-party/foo