5.2 导出配置

导出配置

龶龲龯龮龬龫龨龧龤龠龟龛龚龖

  • 龓龏龧龤 – 龋龈龅龂齾龶龠龟龧龤齺齹齸齶齵齲齯齬齪1齦
    龧齥齢 /admin/config/development/configuration/full/export鼰龅鼭鼩龧龤鼥鼡鼟鼰鼛鼘 config-xxx.tar.gz 龂齶齵齲鼏鼋鼊鼆鼊鼃龖
  • 鼂黾龧龤 – 黺黶黲黯龂龧龤龠龟鼰黾黬龧龤黫齸龛龚龖齯齬齪2齦
    龧齥齢 /admin/config/development/configuration/single/export鼰黺黶鼩龠龟黧黦鼥黢鼩龠龟點黛鼥黗黔黓黏龧龤龂龠龟龖
  • Drush – 黶 Drush 龧龤龠龟
    黈黄黂黁麾麺黺黶 Drush 龧龤麶龠龟龖
    龧龤麲麱黧麭麩麨麤
    sites/default/files/config_[your config path]/sync
    drush config-export

    龧龤麕黂黁麑龫龨龋麎黏龂龠龟龛龚拷麊齢麆麃龂麂鹿鹽麶龖

创建空模块

鹼鹹鹷麂鹿龂鹳鹱鹭鼊麤

  1. 鹫 Drupal 8 龂麂鹿鹧鹣鹼鹹 fields_example 鹧鹣
  2. 鹼鹹鹟鹧鹣 config
  3. 鹫 config 鹽鹼鹹鹧鹣 install
  4. 鹜龧龤龂龠龟鹽拷麊 node.type.external.yml 龛龚鹚鹫 config/install 鹧鹣鼊
  5. 鹫 fields_example 鹘鼊鹼鹹 external.info.yml 龛龚齯麂鹿點齺麤 External Link Content Type

麲麱黧麭麩麨麤

fields_example/ |-- config/ | |-- install/ | |-- node.type.external.yml |-- external.info.yml 

鹆鹂鸿鸻鼊鸺鸸麂鹿鸶麨鹼鹹鹽鸵黧黦麶龖

  1. 鸳 /admin/structure/types鼰鸯鸭黂黁鸫鸪鹼鹹龂 External 鹽鸵黧黦龖
  2. 鸳鼩鸨鸦鼥鸢鸞 External Link Content Type 麂鹿
  3. 鸳 /node/add/external鼰黓鼏鸻齢 External 鹽鸵黧黦龂黄龅鸜鸙鸗黲

鸓鹫黂黁龶麶齹齸鸑鸐 External 鹽鸵黧黦鸌鸉鸈鸆鸃鷿鷽龂麂鹿龖鸳鼩鸨鸦鼥鷼鼆麩齸麂鹿鼰齺鼊齹鹳鼘鷹鷶龖

节点追加表单

增加字段配置文件

龋黈齹黄黂黁龧龤龂鷵鷳龠龟龛龚鹚龟鹫 fields_example/config/install/ 目录内。

鷲鷮龶麩鷫龛龚麤

  • core.entity_form_display.node.external.default.yml
  • core.entity_view_display.node.external.default.yml
  • core.entity_view_display.node.external.teaser.yml
  • field.field.node.external.body.yml
  • field.field.node.external.field_image.yml
  • field.field.node.external.field_url.yml
  • field.storage.node.field_url.yml

鷣鷡鸢鸞麩齸麂鹿龖鸳 /node/add/external 鷠鸻黄龅鸜鸙鸗黲鼰body鷜url 黢 screenshot 鷚鷗鷓鼏鼋鸗鷒龤鼃龖

评论 (写第一个评论)