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

评论 (写第一个评论)