Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / user_view.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view.twig
new file mode 100644 (file)
index 0000000..7c427d7
--- /dev/null
@@ -0,0 +1,13 @@
+/**
+ * Implements hook_user_view().
+ */
+function {{ machine_name }}_user_view($account, $view_mode, $langcode) {
+  if (user_access('create blog content', $account)) {
+    $account->content['summary']['blog'] =  array(
+      '#type' => 'user_profile_item',
+      '#title' => t('Blog'),
+      '#markup' => l(t('View recent blog entries'), "blog/$account->uid", array('attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => format_username($account)))))),
+      '#attributes' => array('class' => array('blog')),
+    );
+  }
+}