![](/img/trans.png)
[英]How to add a new custom field to "Site Infomation" Form in Drupal8
[英]how to add custom properties in drupal8's configuration entity
我想在配置實體(user_role)中添加自定義屬性。
e.g.
administrator {
id: administrator,
label: administrator,
isadmin: true,
..,
--> client_id:1
}
但我找不到如何覆蓋現有配置實體的屬性。
所以請幫我
通常,Drupal 8中的實體具有可以附加到它們並可以擴展其功能的fields
(屬性)。
在Drupal 7或8中, Roles
不是真正的實體,默認情況下它們是不可字段設置的。 在Drupal 7中,有一個user_role_field模塊,它允許此功能,但目前在Drupal 8中不存在等效功能。
作為在Drupal 8中的替代方法 ,您可以為user entity
(包含在核心中)創建fields
,並且如果您想要Role specific
於Role specific
字段,則可以為每個字段分配field_permissions ,以便特定角色可以創建/查看/編輯它們。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.