如何删除Drupal 8中的“最后保存”和“作者”字段?

这里的回答对如何删除创作信息?没有帮助
我试过通过form_alter把它藏起来,但是没有运气.
我很感谢你的帮助和建议.已经在这件事上浪费了很多时间。
我在kint($form)中得到的部分内容;如果这可以帮助您的话:
→'meta' => array(10)
'#type' => string(7) "details"
'#group' => string(8) "advanced"
'#weight' => integer-10
→'#title' => Drupal\Core\StringTranslation\TranslatableMarkup(5)
contents Available methods (14)
protected translatedMarkup -> NULL
protected options -> array(0)
→protected stringTranslation -> Drupal\Core\StringTranslation\TranslationManager(4)
contents Available methods (10)
→protected translators -> array(2)
→'30' => array(1)
*DEPTH TOO GREAT*
→'0' => array(1)
*DEPTH TOO GREAT*
→protected sortedTranslators -> array(2)
→Drupal\Core\StringTranslation\Translator\CustomStrings(4)
*DEPTH TOO GREAT*
→Drupal\locale\LocaleTranslation(9)
*DEPTH TOO GREAT*
protected defaultLangcode -> string(2) "en"
public _serviceId -> string(18) "string_translation"
protected string -> string(6) "Status"
protected arguments -> array(0)
→'#attributes' => array(1)
→'class' => array(1)
string(19) "entity-meta__header"
'#tree' => boolTRUE
'#access' => boolTRUE
→'published' => array(4)
'#type' => string(4) "item"
→'#markup' => Drupal\Core\StringTranslation\TranslatableMarkup(5)
contents Available methods (14)
protected translatedMarkup -> NULL
protected options -> array(0)
→protected stringTranslation -> Drupal\Core\StringTranslation\TranslationManager(4)
contents Available methods (10)
→protected translators -> array(2)
*DEPTH TOO GREAT*
→protected sortedTranslators -> array(2)
*DEPTH TOO GREAT*
protected defaultLangcode -> string(2) "en"
public _serviceId -> string(18) "string_translation"
protected string -> string(9) "Published"
protected arguments -> array(0)
'#access' => boolFALSE
→'#wrapper_attributes' => array(1)
→'class' => array(1)
string(18) "entity-meta__title"
→'changed' => array(4)
'#type' => string(4) "item"
→'#title' => Drupal\Core\StringTranslation\TranslatableMarkup(5)
contents Available methods (14)
protected translatedMarkup -> NULL
protected options -> array(0)
→protected stringTranslation -> Drupal\Core\StringTranslation\TranslationManager(4)
contents Available methods (10)
→protected translators -> array(2)
*DEPTH TOO GREAT*
→protected sortedTranslators -> array(2)
*DEPTH TOO GREAT*
protected defaultLangcode -> string(2) "en"
public _serviceId -> string(18) "string_translation"
protected string -> string(10) "Last saved"
protected arguments -> array(0)
→'#markup' => Drupal\Core\StringTranslation\TranslatableMarkup(5)
contents Available methods (14)
protected translatedMarkup -> NULL
protected options -> array(0)
→protected stringTranslation -> Drupal\Core\StringTranslation\TranslationManager(4)
contents Available methods (10)
→protected translators -> array(2)
*DEPTH TOO GREAT*
→protected sortedTranslators -> array(2)
*DEPTH TOO GREAT*
protected defaultLangcode -> string(2) "en"
public _serviceId -> string(18) "string_translation"
protected string -> string(13) "Not saved yet"
protected arguments -> array(0)
→'#wrapper_attributes' => array(1)
→'class' => array(1)
string(23) "entity-meta__last-saved"
→'author' => array(4)
'#type' => string(4) "item"
→'#title' => Drupal\Core\StringTranslation\TranslatableMarkup(5)
contents Available methods (14)
protected translatedMarkup -> NULL
protected options -> array(0)
→protected stringTranslation -> Drupal\Core\StringTranslation\TranslationManager(4)
contents Available methods (10)
→protected translators -> array(2)
*DEPTH TOO GREAT*
→protected sortedTranslators -> array(2)
*DEPTH TOO GREAT*
protected defaultLangcode -> string(2) "en"
public _serviceId -> string(18) "string_translation"
protected string -> string(6) "Author"
protected arguments -> array(0)
'#markup' => string(5) "@dmin"
→'#wrapper_attributes' => array(1)
→'class' => array(1)
string(19) "entity-meta__author"发布于 2018-09-11 08:33:12
如果我正确理解了您的需求,那么您应该转到内容类型Manage form display配置页面,它应该在:/admin/structure/types/manage/YOUR_CONTENT_TYPE/form-display下面。
然后通过将Authored by和/或Authored on拖到表中的禁用区域,然后单击“保存”,从而禁用它们。

https://drupal.stackexchange.com/questions/269122
复制相似问题