cms/README.md
changeset 104 bd3747a1cd5f
parent 14 10f67f0281e1
equal deleted inserted replaced
103:d7fbe237f779 104:bd3747a1cd5f
     8 
     8 
     9 * [Node.js](http://nodejs.org/) (with NPM)
     9 * [Node.js](http://nodejs.org/) (with NPM)
    10 
    10 
    11 ## Installation
    11 ## Installation
    12 
    12 
    13 * `npm install --prefix app-client/` (install the dependencies of the ember app)
    13 * `npm install` (install gulp and some dependencies)
    14 * `npm install`
    14 * In the /app-client directory
       
    15   * `npm install` (install the dependencies of the ember app)
       
    16   * `bower install`
    15 
    17 
    16 ### Building
    18 ### Building
    17 
    19 
    18 To build the module, you need to build the ember app then to copy the correct files into the modules folder. It can easily be done by the following command line:
    20 To build the module, you need to build the ember app then to copy the correct files into the modules folder. It can easily be done by the following command line:
    19 
    21 
    20 * `npm run build`
    22 * `npm run build`
    21 
    23 
    22 It will first run `npm run build --prefix app-client` which will build the ember app, and then run `gulp copy-module` to copy the built files into the module folder.
    24 It will first run `npm run build --prefix app-client` which will build the ember app, and then run `gulp copy-module` to copy the built files into the module folder.
    23 
    25 
       
    26 **Don't Forget !**
       
    27 
       
    28 If the config/environnement.js has been modified, you must get the new meta line in dist/index.html
       
    29 > `<meta name="app-client/config/environment" content="ELEMENTS_FROM_CONFIG" />`
       
    30 
       
    31 And copy it in corpus_module/corpus.module in the function `corpus_page()`
       
    32 ```php
       
    33 <?php
       
    34 function corpus_page() {
       
    35 ...
       
    36 $element = array(
       
    37     '#tag' => 'meta', // The #tag is the html tag - <link />
       
    38    '#attributes' => array( // Set up an array of attributes inside the tag
       
    39      'name' => 'app-client/config/environment',
       
    40      'content' => 'ELEMENTS_FROM_CONFIG'
       
    41    ),
       
    42  );
       
    43  ```
       
    44 
       
    45  Finally replace the `baseStatic` value by `/'.drupal_get_path('module', 'corpus').'/app-client/`. This way, Drupal will fill the value with the correct path to the corpus module.
       
    46 
    24 ### Deploy
    47 ### Deploy
    25 
    48 
    26 Once the module has been updated with the correct built app, you can compress it and share it.
    49 Once the module has been updated with the correct built app, you can **compress** it and **share it**.
    27 To include the compressed module to a Drupal website, simply unzip the module and place it in the modules/ folder in your Drupal project.
    50 To include the compressed module to a Drupal website, simply **unzip** the module and place it in the `modules/ folder` in your Drupal project.
    28 Report to the README inside the module folder for further informations.
    51 Report to the **README** inside the module folder for further informations.