1 field.block.inc FieldBlock::getTitle()

Sets block subject on block view.

Overrides Block::getTitle

File

core/modules/field/field.block.inc, line 60

Class

FieldBlock
FieldBlock extends Block

Code

function getTitle() {
  $title = parent::getTitle();

  if (empty($title) && $this->settings['title_display'] === LAYOUT_TITLE_DEFAULT) {
    list($entity_type, $field_name) = explode('-', $this->childDelta);
    $entity = $this->contexts[$entity_type]->data;
    $instance = field_info_instance($entity->entityType(), $field_name, $entity->bundle());
    $title = t($instance['label']);
  }

  return $title;
}