Skip to content
Snippets Groups Projects
Commit b7aece63 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #668650 by jhodgdon: fixed hook_view() example.

parent c4962c97
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -999,11 +999,10 @@ function hook_validate($node, &$form) {
function hook_view($node, $view_mode = 'full') {
if (node_is_page($node)) {
$breadcrumb = array();
$breadcrumb[] = array('path' => 'example', 'title' => t('example'));
$breadcrumb[] = array('path' => 'example/' . $node->field1,
'title' => t('%category', array('%category' => $node->field1)));
$breadcrumb[] = array('path' => 'node/' . $node->nid);
menu_set_location($breadcrumb);
$breadcrumb[] = l(t('Home'), NULL);
$breadcrumb[] = l(t('Example'), 'example');
$breadcrumb[] = l($node->field1, 'example/' . $node->field1);
drupal_set_breadcrumb($breadcrumb);
}
$node->content['myfield'] = array(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment