For my assignment I have to write a module that when enabled will prepend a text of string "Hello World" to the body of a text field of hello_world_article content type.
I first tried to use Drupal 8 config export to try to set a default value (hello World) by using a yml file. However I get an error enabling the module that " field.field.node.hello_world_article.body already exists in active configuration."
My yml file is:
uuid: 42c51471-d897-4cb1-ac37-b2b6cddc6f0e58
langcode: en
status: true
dependencies:
config:
- field.storage.node.body
- node.type.hello_world_article
module:
- text
_core:
default_config_hash: e_0gHBXrh9sHHe-XksjIYpOmFEiugHbtoJdYPxbftAI
id: node.hello_world_article.body
field_name: body
entity_type: node
bundle: hello_world_article
label: Body
description: ''
required: false
translatable: true
default_value:
-
summary: ''
value: "<p><em>Hello World!</em></p>\r\n\r\n<p> </p>\r\n"
format: basic_html
default_value_callback: ''
settings:
display_summary: true
field_type: text_with_summary
How else would I get about approaching this problem. Help would be much appreciated.