How to change Title field label and description for Custom Content Entity

by Janey   Last Updated May 09, 2017 10:07 AM - source

I've created a custom content entity (generated via drupal console), I can add custom fields just fine via the cms.

What I'm try to do now is change the default label from 'Name' to 'Artwork Title'.

I've tried the following, but I'm not seeing the changes.

class EntryEntityForm extends ContentEntityForm {

       * {@inheritdoc}
      public function buildForm(array $form, FormStateInterface $form_state) {
        $form = parent::buildForm($form, $form_state);

        $form['name']['widget']['#title'] = $this->t('Artwork Title');
        $form['name']['widget'][0]['#title'] = $this->t('Artwork Title');

        $entity = $this->entity;

        return $form;

Can someone please point me in the right direction?

Related Questions

Validate File Extension In Drupal 8 Entity Form

Updated March 03, 2016 05:03 AM

Get the Entity form value from radio button

Updated July 31, 2017 21:07 PM

Require field on publish only

Updated April 20, 2018 20:07 PM