User Tools


===== DIRECTORY STRUCTURE AND FILES for CMTS =====

cmts - Main files for cmts frontend. Mantained by MTS.
/site - this directory.
/site/cache - cache directory for generated and / or retrieved data. Must be writable.
/site/cache/clear.php - offers clear functionality for cache directories. A cache directory to be \\cleared can be specified, also “mem” for clearing memcache and “*” for clearing all directories including memcache.

  Example usage:
  
  http://dev.mydomain.com/site/cache/clear.php?*  
  http://dev.mydomain.com/site/cache/clear.php?mem  
  http://dev.mydomain.com/site/cache/clear.php?js 

/site/cache/css - generated css, minified when in production. please note file cache for generated css is not used when memcache is active.
/site/cache/js - generated javascript, minified when in production. please note file cache for javascript is not used when memcache is active.
/site/cache/data - files linked in the css converted to base64, for re-use when regenerating css from less.
/site/cache/json - json data from f-mts. This is handled automatically. For your understanding what is going on:

  • When the file format is <userid>-<module>-<language>.json data is retrieved from http://www.f-mts.com/<userid>/<language>/<module>/export.json.
  • When the file format is <userid>(<offergroup>)-<module>-<language>.json data is retrieved from http://www.f-mts.com/<userid>/<language>/<module>/export.json?offergroup=<offergroup>.
  • The filename is a hash when the retrieved json had a custom address.

Example: u0421-activities-de.json = http://www.f-mts.com/u0421/de/activities/export.json

/site/common/ - holds commonly used stuff. usually there will be no need to extend directory structure.
/site/common/html - main layout templates

  • cmts.html - main wrapper template. usually not to edit, except for adding special meta tags. you should add all values for meta tags to the config [site.meta].
  • [layout.template].html - layout of the current page loaded into main template and filled with rendered contents from the modules. rendered content is split by section name. block-independent static content which does not change throughout the pages and using this layout can be static in this file and is usually styled in layout.less / layout.css.

/site/common/img - all images used on the frontend for the layout. usually it is a good idea to put files in subdirectories corresponding to the module name which uses them, and put commonly used images (e.g. the ones linked in [layout.template].html) directly in this folder.
Note: Please use /img/module/yourimage.png to include the file /site/common/img/module/yourimage.png in your css or html, not the full path.

/site/common/js - global javascripts (not libraries). Usually there will be common.js and stats.js.

  • common.js: really global stuff for the whole site, which does not reference any specific module. All module related stuff is in the module's own folder.

You will not want to change cmts internationalization functions. You can add your own code below that.

/site/common/less - all global less files, which do not belong to a library or module. please overwrite your library default styles within a mixin named after the library in layout.less.

  • config.less: global variable definition, functions. GENERATES NO OUTPUT, ONLY VARIABLE AND FUNCTIONS DEFINITION
  • layout.less: contains global styles as commonly used mixins, used in frontend and backend editor. GENERATES NO OUTPUT, ONLY MIXIN DEFINITION
  • fonts.less: contains @imports for google webfonts, nothing else. used in frontend and backend editor (tinymce).
  • frontend.less: contains global styles for the frontend. Not used in backend editor. can use mixins and functions from config.less and layout.less.
  • backend.less: contains backend editor styles applied to the body of the tinymce editor. can use mixins and functions from config.less and layout.less.

Please do not add more files to this directory. use mixins in layout.less for your layout definitions and output them in frontend.less and/or backend.less. Module specific styles are in the according less files for modules, not all together mixed up in frontend.less. frontend.less should style the sections and static content for the different frontend layouts, not the rendered blocks.

/site/common/less/lib - all less files overwriting styles from a third party library in /site/common/lib. Please only one file per library / plugin. This files are always included right after the library styles for overwriting the default styles. See definition in config: “styles[0]frontend.common” and “plugins”

/site/common/lib - third party (js) libraries. Please don't use CDN. Use a version number folder, if the version is relevant for the library, to easily switch between versions instead of replacing the files every time.

/site/config - site configuration files

  • config.php - some client specific constants, explained in the file
  • config.yml - global site, layout, redirects, routes, blocks and configuration as YML. Use an Editor which can collapse / expand YML for easier reading. See comments in the file.
  • humans.txt / robots.txt - standard; can be called with dev.yourdomain.com/robots.txt

/site/modules - contains all independent modules used on the site.

/site/modules/<modulename> - contains module controller, model and view as php-Files in CamelCase.

/site/modules/<modulename>/views/<viewname>/

  • html templates for the view <viewname>. file name corresponds to the view name of the module. This is equal to the controller method called and the default view method on the view class for the module.
  • javascript files for the views. Javascript code in a file does only stuff within the block container of the module. file name corresponds to the view name of the module. if it is <modulename>.js and stored in /views/ (parent directory), it is included once when the module is used on the page, regardless of the view name called on the module.
  • less files for the views. Less css in a file does only style elements within the block container of the module and the block's container itself. Attention for editor styles, these are explained in the coding guidelines http://i-mts.net/wiki/standards/doku.php?id=website_coding_guidelines . File name corresponds to the view name of the module. if it is <modulename>.less and stored in /views/ (parent directory), it is included once when the module is used on the page, regardless of the view name called on the module.
  • other files which are used only by this view, except images.