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

评论 (写第一个评论)