5.1 实体字段

龸龶龲龯龫龧龤龠龞龚龙龕龓龒龑龏龍龌龉龕龅龄龃龂 Drupal 齰齮齪齨齥龲齤齡齟齛齚龓齗齖齒齏齎齊齮齪齨齥齆

齅齁鼽鼺鼸鼶 Drupal 鼳鼯龕 YML 齨齥鼨



core/profiles/standard/config/install/field.storage.node.field_image.yml

鼽鼺鼸鼅鼂鼁黾黻黷齰 YML 齨齥黴黲黯黬龚龙黪黩黨黦黥黢黡點黜默黖黓黐齆

本课内容

  • 黌黉 examples/field_example 齛齚
  • 黇黄 Drupal 7 麾 Drupal 8 黯黬龚龙龕麶麳
  • 麰麯齏齛齚龫龧麮麫麪龚龙
  • 麰麯齏齛齚麦麤麣麟龕龚龙

创建“初始导出配置”

齟齅齁黾黻齏麜麙麖麔麒齮齪齤麎龲麋龯麉麆麂麁鹿龕鹻鹺齮齪鹸鼅鹴齨齥鹲鹮齆

齎鹫鹨齅齁鹥鹢麟鹞龕齮齪黦齟麶麳鹝鹛鹗鹔鹐齮齪齆

鹌鹺鹈鹥鹢 Drush 鹴龍鹢鹁鸿齡龲鸾鸽鼺鼶鸼鸹鼨

drush config-export

鸶鸴鸱鹥鸯 Drush 鸮鸭龲鸪鸩鼸 Drush based workflow

创建一个新的内容类型

齤麎鸢鸟鸝鹈鸚鸘鸕鸴鸓鸐龫龧龓龒龑龏龲齅齁鸌齟龯龫龧龤龠齆

  1. 鹌鸈 Link 齛齚鸄鸀
  2. 龫龧鹢龓龒龑龏 External龲鸈麟黦鷾鷽龚龙齆
  3. 鷻鷺龤龠鹢龕 Link 龚龙龲鷷鷵鷳 URL黦鷩齪麆鷧 1黦鸈麟齆
  4. 鷟鷜齒齏 image 龚龙龲鷷鷵鷳 Screenshot黦鸈麟齆

鹸鷗鹴 /node/add 龲鷖鷕鼸鹴鹢龕龓龒龑龏 External 齆

什么是 Configuration Manager ?

Configuration Manager 齛齚鷑鷐鸴龤龠齏麜麙麖龲齏鷏鹸鷌黦鹸鼅齮齪麤鹥龲鷋鸓齟鷈鷅龕鸯龠黯鷋鹗鷂鷀龙齮齪麆麂齆

查看配置变更

鹸鷗鹴齮齪麔麒鶾鷂 /admin/config/development/configuration龲鷖鷕鼸鹴齎齊鸮鸭鶶鶳鶰鶮龓龒鶬鶨鼨

拷鶤鸮鸭龲鼶鶣鷕齏鹴齆

齎齊齮齪齨齥龃鶡鶟鶞

齮齪齨齥鶝鶛龃齮齪鷩齪龲鹻鹺麟鹞齟麆麂麁龓龲鶝鼽鼺鹸鼅鷳齮齪齨齥齆

齅齁鶚鹸鼅齎齊鷩齪龲齟齅齁齛齚龓齒齏齆

Your current configuration has changed. Changes to these configuration items will 
be lost on the next synchronization:
* core.entity_form_display.node.external.default
* core.entity_view_display.node.external.default
* core.entity_view_display.node.external.teaser
* core.extension
* field.field.node.external.body
* field.field.node.external.field_image
* field.field.node.external.field_url
* field.storage.node.field_url
* node.type.external
* user.role.administrator

鶙鶗齅齁麾鶓鶏龕 UI 鶈龉鶇鶆鼸鼶鶃龠齨齥龃鶡鶟鼨

  • node.type.external
    龓龒龑龏鷾鷽鶈龉鶀黴龕 设置
    鵿鵽: /admin/structure/types/manage/external
  • core.entity_form_display.node.external.default
    鷾鷽齛龄鼶龲麫麪龚龙鶈龉黌齥鸓鸐鶈鵶龕 设置
    鵿鵽: /admin/structure/types/manage/external/form-display
  • core.entity_view_display.node.external.default
    默认查看模式下,定义字段如何表示的设置。
    鵿鵽: /admin/structure/types/manage/external/display
  • core.entity_view_display.node.external.teaser
    teaser 查看模式下,定义字段如何表示的设置。
  • field.field.node.external.body
    麫麪龚龙 body 龕鷩齪齆
  • field.field.node.external.field_image
    麫麪龚龙 field_image 龕鷩齪齆
    鵿鵽: /admin/structure/types/manage/external/fields/node.external.field_image
  • field.field.node.external.field_url
    麫麪龚龙 field_url 龕鷩齪齆
    鵿鵽: /admin/structure/types/manage/external/fields/node.external.field_url
  • field.storage.node.field_url
    麫麪龚龙 field_url 麟鹞龕鷩齪齆
    鵿鵽: /admin/structure/types/manage/external/fields/node.external.field_url/storage

field.field 和 field.storage 文件有什么不同?

龚龙 API 麫麪鸴鵰龠鵬龯麆麂鵫鵨 FieldStorage 麾 Field 龲鵦鵢龤龠鵟麫鵛鵙齆

FieldStorage 麫麪鸴龤鵕鵔麫龕龑龏麆麂龲鵐鵍鷏黯黬齆Field 鵐鵍鷏龉鵌龕鵟麫齆

龤龠鵟麫鶝鼽鼺麒鸱鷳鵉鵆鹴龤龠鼽龚龙鵅黯黬龑龏龕龤黌龚龙齆

龯鸴鸱鹥鸯鵉鷏鵟麫黦龚龙麾黯黬龑龏鵃鴿鸪鸩鼸 An Introduction to Entities

评论 (写第一个评论)