Directory Structure

Improvements?

Let us know by posting here.

Base Directories

The default installation of Concrete CMS is setup in the following manner. (The root directory in these examples corresponds to the root of your Concrete website. These examples also assume you are running one website, and not sharing the Concrete core amongst several sites.)

application/

This is the application directory. It includes all items that are specific to this single website. In general, items in the application/ directory that also appear in the concrete directory override those in the concrete directory.

concrete/

This is the concrete source directory. When a new version of Concrete is downloaded this is the directory that contains most of the core files.

packages/

This directory contains sub-directories in the Package format. These are either custom-built packages or (more likely) packages that have been downloaded from the concretecms.org marketplace.

updates/

This directory contains additional Concrete core directories. These may be downloaded using the built-in Concrete updater (found in the Dashboard), or they may have been put in this directory manually. If a file named update.php appears in application/config, its contents will determine which core from the updates/ directory to use to currently power the website.

Concrete Source Directories

concrete/attributes/

This directory contains all the Attribute Types found in Concrete by default. These are activated in the database before they can be used. This happens during installation or upgrade.

concrete/authentication/

This directory contains all the Authentication Types found in Concrete by default. These are installed during installation.

concrete/blocks/

This directory contains all the Block Types found in Concrete. These are activated in the database before they can be used. This happens during installation or upgrade.

concrete/bootstrap/

This directory contains PHP procedures that are run during startup of Concrete. Examples include bootstrap/autoload.php (which, when included sets up all PHP autoloaders), bootstrap/helpers.php (which creates some useful global functions like array_to_object(), h() and t()) and bootstrap/start.php, which starts the actual bootstrapping process.

concrete/config/

This directory contains core configuration data. This data is read and saved by the Config library. Files in here contain the default configuration values for the various keys. The contents of each of these files is an associative array.

concrete/config/doctrine/

This directory contains PHP proxy classes generated by the built-in Doctrine ORM library. These are not something most developers need to worry about.

concrete/config/install/

This directory contains the Starting Point Packages used as sample content, available during installation.

concrete/controllers/

This directory contains controllers. In Concrete, controllers can be run in three ways.

  1. As specified by routes to a specific URL.
  2. Automatically when a single page is rendered.
  3. Automatically when a page of a certain type is rendered.

concrete/controllers/single_page

All controllers in here are automatically loaded when a single page at the same path is loaded.

concrete/controllers/page_types/

All controllers in here correspond to the handle of a specific page type. Whenever a page of that type is loaded, a controller will also be loaded and run, if it exists.

Everything Else

All other controllers in the controllers/ directory are used by specific administrative routes. You can see how these routes and controllers interact by looking at the routes section of concrete/config/app.php

concrete/css

This directory contains minified, compiled CSS used by Concrete.

concrete/css/build/

This directory contains unbuilt source LESS files, compiled by Concrete using Grunt during the build process. This happens prior to shipping a working Concrete, and is not something end users have to understand or care about.

dispatcher.php

This is the main Concrete dispatcher file. It is included by the index.php file in the web root.

concrete/elements

The elements directory contains snippets of PHP code reused by Concrete.

concrete/images

This directory contains images used by Concrete.

concrete/jobs

This directory contains PHP classes that correspond to installed Concrete Jobs. Each Job is a self-contained PHP class with certain required methods.

concrete/js

This directory contains minified, compiled JavaScript used by Concrete.

concrete/js/build/

This directory contains unminified source JavaScript files, compiled by Concrete using Grunt during the build process.

concrete/mail

This directory contains mail templates. These are used by the Mail Service.

concrete/single_pages

This directory contains single pages used by Concrete. These are activated during installation.

concrete/src/

This directory contains all PHP classes used by Concrete, separated into directories based on function. Important Note: every file and directory up to this point has been named using Concrete's lowercase handle format. Once in the src/ directory things change, and directories and classes are camelcased (with the first letter being uppercased).

concrete/themes/

This directory contains all themes that ship with Concrete. A theme must be activated on installation in order for it to appear in the installed themes list.

concrete/tools

This directory contains tools scripts that are used by certain user interface elements of Concrete. These are officially deprecated in favor of views and controllers, but have not completely been phased out yet.

concrete/vendor

This directory contains third party libraries used by Concrete. These libraries are installed during the build process of Concrete using Composer.

concrete/views

This directory contains views used by Concrete's MVC layer. These views are specified by controllers in the controllers directory.

Application Directory

application/attributes

This directory contains attributes used just by this Concrete installation – or overrides of Concrete core attribute files.

application/authentication

This directory contains authentication types used just by this Concrete installation – or overrides of Concrete core authentication type files.

application/blocks

This directory contains block type code files used just by this Concrete installation – or overrides of Concrete core block type files.

application/bootstrap/app.php

This file is an optional file that developers can use to register events, rebind PHP classes, and more. This file is automatically loaded during the Concrete bootstrap routine.

application/bootstrap/autoload.php

This file is loaded during the Concrete bootstrap routine. It takes care of loading composer items (found in concrete/vendor/) and any custom autoloading necessary for the application.

application/bootstrap/start.php

This file is loaded during the Concrete bootstrap routine. This file enables environment detection and custom application environments.

application/controllers

This directory contains controllers used just by this Concrete installation – or overrides of Concrete core controller files.

application/elements

This directory contains elements used just by this Concrete installation – or overrides of Concrete core elements.

application/files

This directory contains files uploaded to this Concrete installation. Concrete's file importer class manages this directory.

application/files/thumbnails

This directory contains image thumbnails generated automatically for files uploaded to Concrete. The file manager uses some of these thumbnails but new image thumbnail types will automatically place their generated thumbnails in this directory.

application/files/incoming

Files uploaded to this directory are available for import into the file manager in the Dashboard. This can be useful when attempting to upload large files is failing through a browser.

application/files/cache

Internal Concrete cache files are written here. Generally, it is safe to delete this directory entirely if troubleshooting a problem in a Concrete installation.

application/jobs

This directory contains job classes used just by this Concrete installation – or overrides of Concrete core job classes.

application/languages

This directory contains language files used by Concrete. These are populated during the build of Concrete.

application/mail

This directory contains email templates used just by this Concrete installation – or overrides of Concrete email templates.

application/single_pages

This directory contains single page views used just by this Concrete installation – or overrides of Concrete single page views.

application/src

This directory contains custom PHP classes used by this application, or (in some limited cases) overrides of core Concrete PHP classes. Note: this directory obeys the same casing rules as the concrete/src directory.

application/themes

This directory contains custom themes used by this application, or overrides of core Concrete themes or components.

application/tools

This directory contains tools used by this application. These are deprecated in favor of routes, controllers and views.

application/views

This directory contains custom views used by this application, or views that override core Concrete views.