Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
b7aece63
Commit
b7aece63
authored
Jan 04, 2010
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#668650
by jhodgdon: fixed hook_view() example.
parent
c4962c97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
modules/node/node.api.php
modules/node/node.api.php
+4
-5
No files found.
modules/node/node.api.php
View file @
b7aece63
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment