diff --git a/entity.tpl.php b/entity.tpl.php
index cfe94dd..a63824b 100644
--- a/entity.tpl.php
+++ b/entity.tpl.php
@@ -31,6 +31,7 @@
 <div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
 
   <?php if (!$page): ?>
+    <?php print render($title_prefix); ?>
     <h2<?php print $title_attributes; ?>>
       <?php if ($url): ?>
         <a href="<?php print $url; ?>"><?php print $title; ?></a>
@@ -38,6 +39,7 @@
         <?php print $title; ?>
       <?php endif; ?>
     </h2>
+    <?php print render($title_suffix); ?>
   <?php endif; ?>
 
   <div class="content"<?php print $content_attributes; ?>>
diff --git a/includes/entity.controller.inc b/includes/entity.controller.inc
index 6999e12..8af6b39 100644
--- a/includes/entity.controller.inc
+++ b/includes/entity.controller.inc
@@ -500,6 +500,20 @@ class EntityAPIController extends DrupalDefaultEntityController implements Entit
         '#language' => $langcode,
         '#page' => $page,
       );
+
+      // Add in contextual link to edit the entity.
+      // If $page is TRUE, the title won't be output and contextual links can't
+      // be output.
+      if (!$page && isset($this->entityInfo['admin ui']['path'])) {
+        $key = isset($entity->{$this->idKey}) ? $entity->{$this->idKey} : NULL;
+        $build['#contextual_links'] = array(
+          'fragment' => array(
+            $this->entityInfo['admin ui']['path'] . '/manage',
+            array($key),
+          ),
+        );
+      }
+
       // Allow modules to modify the structured entity.
       drupal_alter(array($this->entityType . '_view', 'entity_view'), $build, $this->entityType);
       $key = isset($entity->{$this->idKey}) ? $entity->{$this->idKey} : NULL;
diff --git a/includes/entity.ui.inc b/includes/entity.ui.inc
index 30d3c86..360a71a 100644
--- a/includes/entity.ui.inc
+++ b/includes/entity.ui.inc
@@ -71,6 +71,7 @@ class EntityDefaultUIController {
       'title' => 'Edit',
       'load arguments' => array($this->entityType),
       'type' => MENU_DEFAULT_LOCAL_TASK,
+      'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE
     );
 
     // Clone form, a special case for the edit form.
