You are here

function eck_title_property_entity_view in Entity Construction Kit (ECK) 7.3

Same name and namespace in other branches
  1. 7.2 plugins/property_behavior/title.inc \eck_title_property_entity_view()

When we are viewing the entity, set the pages title.

1 string reference to 'eck_title_property_entity_view'
title.inc in plugins/property_behavior/title.inc

File

plugins/property_behavior/title.inc, line 47

Code

function eck_title_property_entity_view($property, $vars) {
  $entity = $vars['entity'];
  $title = _eck_title_property_extract_title($entity, $property);
  if (empty($title)) {
    $tile = "{$entity->entityType()} : {$entity->id}";
  }
  $uri = entity_uri($entity
    ->entityType(), $entity);
  if ($uri['path'] == current_path()) {
    drupal_set_title($title);
  }
}