I am using Drupal 8 theme and i am wondering is there any way to change the phrase Sticky at top of lists which appears when creating new posts, to something different like Appear in Search Results or Trending?

screen shot of menu


In a custom Drupal module do something like:

function sfusd_scheduler_form_alter(&$form, $form_state, $form_id)
    // Let's change sticky at top of lists to client preferred verbiage
    $form['sticky']['widget']['value']['#title'] = 'Pinned to top of announcement list';

I found a not so clean way if you're still looking for this.

in the following file: \core\modules\node\src\Entity\Node.php on line 414(for me)

$fields['sticky'] = BaseFieldDefinition::create('boolean')
  ->setLabel(t('Sticky at top of lists'))
  ->setDisplayOptions('form', array(
    'type' => 'boolean_checkbox',
    'settings' => array(
      'display_label' => TRUE,
    'weight' => 16,
  ->setDisplayConfigurable('form', TRUE);

Change the setLabel value and clear your cache, and the text will be changed. if someone has a neater way of doing this please correct my answer.

Since this is in core i would recommend making a text file and adding the line you replaced and give some extra info because with a drupal update you will have to change this again.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.