Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

PLAT-171 Update info file #174

Merged
merged 9 commits into from
Apr 20, 2016
43 changes: 33 additions & 10 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
## Development instructions

### Managing configuration
### Manually

#### Managing configuration

All custom code should be part of the `cr` profile, and more specifically as part of the profile itself, either as custom modules (previously `features`) in `profiles/cr/modules/custom`, either as part of the theme in `profiles/cr/themes/`.

Configuration management is handled using the contrib module [`config_devel`](http://drupal.org/project/config_devel), which is a "light-weight" version of what we were using `features` for.
Configuration management is handled using the contrib module [`config_devel`](http://drupal.org/project/config_devel), which is a "light-weight" version of what we were using `features` for.

A typical workflow goes like

Expand All @@ -13,7 +15,7 @@ A typical workflow goes like
pathauto.pattern.article
views.view.articles
...

to find the relevant configuration snippets that need to be exported, in this case, related to the "article" content type. You can also the GUI at `admin/config/development/configuration/single/export` to find these configuration files.

We now add these snippets to the `cr_article.info.yml` file, like
Expand All @@ -22,7 +24,7 @@ We now add these snippets to the `cr_article.info.yml` file, like
- node.type.article
- pathauto.pattern.article
- views.view.articles

And we then export these to code, using

> drush cde cr_article
Expand All @@ -32,18 +34,18 @@ You can now check the updated `.yml` files in `cr_article/config/install`, and c
When you want to do the opposite action (e.g. the `features-revert` functionality), you can use

> drush cdi cr_article

to import everything from `cr_article/config/install` into the database.

### Managing default content
#### Managing default content

Default content can be exported as part of the `cr_default_content` module.

To export content, you need to create a node, taxonomy term, or generally any type of entity first via the UI. Once created, grab the entity id and entity type, and run

> drush dcer node 12 --folder=profiles/cr/modules/custom/cr_default_content/content
This will export the node plus all references (such as images, files, taxonomy terms, etc.) and structure this in the `content` folder of `cr_default_content`.

This will export the node plus all references (such as images, files, taxonomy terms, etc.) and structure this in the `content` folder of `cr_default_content`.

You will need to remove the automatically exported user as this generates problems for the installation.

Expand All @@ -55,8 +57,29 @@ This sometimes creates problems with serial identifiers (e.g. file id 7), as the
"href": "http:\/\/default\/file\/7?_format=hal_json"
},

to
to

"self": {
"href": "http:\/\/default\/file\/7777?_format=hal_json"
},
},


### Using Phing

#### Managing configuration

Run

phing config:export

to export all config in one go.

#### Managing default content

To update one node at a time, run

phing content:export:save -Dtype=node -Did=69

If you want to update the content or you added the uuid manually in `cr_default_content.info.yml`, you only have to run

phing content:export
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
{
"_links": {
"self": {
"href": "http:\/\/default\/block\/1111?_format=hal_json"
"href": "http:\/\/default\/block\/4?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/block_content\/teaser"
},
"http:\/\/drupal.org\/rest\/relation\/block_content\/teaser\/field_teaser_image": [
{
"href": "http:\/\/default\/file\/29?_format=hal_json"
"href": "http:\/\/default\/file\/13?_format=hal_json"
}
]
},
"id": [
{
"value": "4"
}
],
"uuid": [
{
"value": "0afb60f3-6b24-4313-ab00-db013888d84c"
}
],
"revision_id": [
{
"value": "4"
}
],
"langcode": [
{
"value": "en",
Expand Down Expand Up @@ -65,7 +75,7 @@
{
"_links": {
"self": {
"href": "http:\/\/default\/file\/29?_format=hal_json"
"href": "http:\/\/default\/file\/13?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/file\/image"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
{
"_links": {
"self": {
"href": "http:\/\/default\/block\/2?_format=hal_json"
"href": "http:\/\/default\/block\/6?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/block_content\/cw_row_block"
},
"http:\/\/drupal.org\/rest\/relation\/block_content\/cw_row_block\/field_cw_block_reference": [
{
"href": "http:\/\/default\/block\/1?_format=hal_json"
"href": "http:\/\/default\/block\/3?_format=hal_json"
}
]
},
"id": [
{
"value": "6"
}
],
"uuid": [
{
"value": "0b9042ac-8196-4cda-9604-4eae9b325279"
}
],
"revision_id": [
{
"value": "6"
}
],
"langcode": [
{
"value": "en",
Expand Down Expand Up @@ -57,7 +67,7 @@
{
"_links": {
"self": {
"href": "http:\/\/default\/block\/1?_format=hal_json"
"href": "http:\/\/default\/block\/3?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/block_content\/teaser"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
{
"_links": {
"self": {
"href": "http:\/\/default\/block\/5?_format=hal_json"
"href": "http:\/\/default\/block\/2?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/block_content\/teaser"
},
"http:\/\/drupal.org\/rest\/relation\/block_content\/teaser\/field_teaser_image": [
{
"href": "http:\/\/default\/file\/23?_format=hal_json"
}
]
}
},
"id": [
{
"value": "2"
}
],
"uuid": [
{
"value": "638bd538-b590-4afd-be51-81f13b6aa027"
}
],
"revision_id": [
{
"value": "2"
}
],
"langcode": [
{
"value": "en",
Expand Down Expand Up @@ -60,29 +65,6 @@
"lang": "en"
}
],
"_embedded": {
"http:\/\/drupal.org\/rest\/relation\/block_content\/teaser\/field_teaser_image": [
{
"_links": {
"self": {
"href": "http:\/\/default\/file\/23?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/file\/image"
}
},
"uuid": [
{
"value": "0fa8d6b8-4e93-4df5-8d4f-79d53c6ef4fb"
}
],
"alt": "",
"title": "",
"width": "1170",
"height": "658"
}
]
},
"field_teaser_link": [
{
"uri": "https:\/\/shop.sportrelief.com\/?_ga=1.252526153.1714528654.1449076275",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"_links": {
"self": {
"href": "http:\/\/default\/block\/6?_format=hal_json"
"href": "http:\/\/default\/block\/5?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/block_content\/teaser"
Expand All @@ -12,11 +12,21 @@
}
]
},
"id": [
{
"value": "5"
}
],
"uuid": [
{
"value": "6d435177-95e0-4d6d-ae50-80e6db199b6c"
}
],
"revision_id": [
{
"value": "5"
}
],
"langcode": [
{
"value": "en",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
{
"_links": {
"self": {
"href": "http:\/\/default\/block\/3?_format=hal_json"
"href": "http:\/\/default\/block\/8?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/block_content\/teaser"
},
"http:\/\/drupal.org\/rest\/relation\/block_content\/teaser\/field_teaser_image": [
{
"href": "http:\/\/default\/file\/18?_format=hal_json"
"href": "http:\/\/default\/file\/20?_format=hal_json"
}
]
},
"id": [
{
"value": "8"
}
],
"uuid": [
{
"value": "76e49bf8-4e9a-4172-b400-c1743e8dfc1d"
}
],
"revision_id": [
{
"value": "8"
}
],
"langcode": [
{
"value": "en",
Expand Down Expand Up @@ -65,7 +75,7 @@
{
"_links": {
"self": {
"href": "http:\/\/default\/file\/18?_format=hal_json"
"href": "http:\/\/default\/file\/20?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/file\/image"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,31 @@
},
"http:\/\/drupal.org\/rest\/relation\/block_content\/cw_row_block\/field_cw_block_reference": [
{
"href": "http:\/\/default\/block\/8?_format=hal_json"
"href": "http:\/\/default\/block\/1?_format=hal_json"
},
{
"href": "http:\/\/default\/block\/4?_format=hal_json"
},
{
"href": "http:\/\/default\/block\/3?_format=hal_json"
"href": "http:\/\/default\/block\/8?_format=hal_json"
}
]
},
"id": [
{
"value": "9"
}
],
"uuid": [
{
"value": "993b8a81-19f0-42b9-bb05-5c55b007a698"
}
],
"revision_id": [
{
"value": "9"
}
],
"langcode": [
{
"value": "en",
Expand Down Expand Up @@ -63,7 +73,7 @@
{
"_links": {
"self": {
"href": "http:\/\/default\/block\/8?_format=hal_json"
"href": "http:\/\/default\/block\/1?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/block_content\/teaser"
Expand Down Expand Up @@ -93,7 +103,7 @@
{
"_links": {
"self": {
"href": "http:\/\/default\/block\/3?_format=hal_json"
"href": "http:\/\/default\/block\/8?_format=hal_json"
},
"type": {
"href": "http:\/\/drupal.org\/rest\/type\/block_content\/teaser"
Expand Down
Loading