Learn

Namespacing

Keeping you from stepping on toes.

Each add-on is namespaced to its own area. You don’t have to do anything to enable this, it happens by default. Your add-on’s namespace is based on the folder name of your add-on. Have an add-on named belt-buckles? Great! You now rule the belt-buckles namespace on any site that your add-on is installed on.

There are some restrictions to this. Statamic comes with a number of bundled first-party “core add-ons” that take precedent (like entries and pages), however, there’s a good chance you won’t run into those.

The way that Statamic’s add-on system is structured, each aspect of your add-on can see the entire scope of your namespace. This means that all aspects of your add-on can work together to create something wholly awesome.

Finally, with the helpers that we’ve built in, you’ll never actually need to reference your namespace anywhere. As long as you stick with our helper methods and objects, we’ll handle the namespacing for you. All you need to do is come up with great ideas and implement them.

This article was last updated on September 13th, 2016. Find an error? Please let us know!