author | ymh <ymh.work@gmail.com> |
Fri, 10 Feb 2017 12:03:12 +0100 | |
changeset 506 | 8a5bb4b48b85 |
parent 104 | bd3747a1cd5f |
permissions | -rw-r--r-- |
14
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
1 |
# Corpus CMS |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
2 |
|
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
3 |
This README describes how to generate a Drupal module embedding a ember app. |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
4 |
|
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
5 |
## Prerequisites |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
6 |
|
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
7 |
You will need the following things properly installed on your computer. |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
8 |
|
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
9 |
* [Node.js](http://nodejs.org/) (with NPM) |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
10 |
|
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
11 |
## Installation |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
12 |
|
104
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
13 |
* `npm install` (install gulp and some dependencies) |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
14 |
* In the /app-client directory |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
15 |
* `npm install` (install the dependencies of the ember app) |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
16 |
* `bower install` |
14
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
17 |
|
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
18 |
### Building |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
19 |
|
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
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: |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
21 |
|
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
22 |
* `npm run build` |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
23 |
|
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
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. |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
25 |
|
104
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
26 |
**Don't Forget !** |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
27 |
|
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
28 |
If the config/environnement.js has been modified, you must get the new meta line in dist/index.html |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
29 |
> `<meta name="app-client/config/environment" content="ELEMENTS_FROM_CONFIG" />` |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
30 |
|
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
31 |
And copy it in corpus_module/corpus.module in the function `corpus_page()` |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
32 |
```php |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
33 |
<?php |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
34 |
function corpus_page() { |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
35 |
... |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
36 |
$element = array( |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
37 |
'#tag' => 'meta', // The #tag is the html tag - <link /> |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
38 |
'#attributes' => array( // Set up an array of attributes inside the tag |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
39 |
'name' => 'app-client/config/environment', |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
40 |
'content' => 'ELEMENTS_FROM_CONFIG' |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
41 |
), |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
42 |
); |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
43 |
``` |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
44 |
|
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
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. |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
46 |
|
14
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
47 |
### Deploy |
10f67f0281e1
move the gulpfile in the cms folder instead of the app - add readme for module and cms
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
48 |
|
104
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
49 |
Once the module has been updated with the correct built app, you can **compress** it and **share it**. |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
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. |
bd3747a1cd5f
update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents:
14
diff
changeset
|
51 |
Report to the **README** inside the module folder for further informations. |