Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
valencia
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
valencia
Commits
f1129685
Commit
f1129685
authored
Aug 31, 2014
by
Riccardo Padovani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove breadcrumb from news pages
parent
a05cae62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
58 deletions
+60
-58
template.php
template.php
+60
-58
No files found.
template.php
View file @
f1129685
...
@@ -286,65 +286,67 @@ function valencia_subheader_menu($vars) {
...
@@ -286,65 +286,67 @@ function valencia_subheader_menu($vars) {
* Also, if there is, we print third level menu
* Also, if there is, we print third level menu
*/
*/
function
valencia_breadcrumb_menu
(
$vars
)
{
function
valencia_breadcrumb_menu
(
$vars
)
{
// Var with all HTML
// Var with all HTML
$html
=
''
;
$html
=
''
;
foreach
(
$vars
[
'links'
]
as
$key
=>
$link
)
{
foreach
(
$vars
[
'links'
]
as
$key
=>
$link
)
{
// See Drupal API, is to print every menu voice only one
// See Drupal API, is to print every menu voice only one
if
(
is_numeric
(
$key
))
{
if
(
is_numeric
(
$key
))
{
// We need only active links
// We need only active links, and we don't want the
if
(
$link
[
'#original_link'
][
'in_active_trail'
])
{
// news page
// If is the first level link and it has children, we start to create the breadcrumb
if
(
$link
[
'#original_link'
][
'in_active_trail'
]
&&
$link
[
'#title'
]
!==
'News'
)
{
if
(
!
empty
(
$link
[
'#below'
])
&&
$link
[
'#original_link'
][
'depth'
]
===
'1'
)
{
// If is the first level link and it has children,
$html
.=
'<ul class="breadcrumb">'
;
// we start to create the breadcrumb
// Now we need to attach second level menu
if
(
!
empty
(
$link
[
'#below'
])
&&
$link
[
'#original_link'
][
'depth'
]
===
'1'
)
{
$sub_menu
=
theme
(
'links__system_main_menu'
,
array
(
$html
.=
'<ul class="breadcrumb">'
;
'links'
=>
$link
[
'#below'
],
// Now we need to attach second level menu
'id'
=>
'breadcrumb'
$sub_menu
=
theme
(
'links__system_main_menu'
,
array
(
));
'links'
=>
$link
[
'#below'
],
$html
.=
$sub_menu
;
'id'
=>
'breadcrumb'
}
));
// Second level link: could be the active one, or only a
$html
.=
$sub_menu
;
// breadcrumb for third level (or both)
}
else
if
(
$link
[
'#original_link'
][
'depth'
]
===
'2'
)
{
// Second level link: could be the active one, or only a
// If it hasn't child, is the active link
// breadcrumb for third level (or both)
if
(
empty
(
$link
[
'#below'
]))
{
else
if
(
$link
[
'#original_link'
][
'depth'
]
===
'2'
)
{
$link_title
=
$link
[
'#title'
];
// If it hasn't child, is the active link
$link_href
=
$link
[
'#href'
];
if
(
empty
(
$link
[
'#below'
]))
{
$html
.=
'<li class="active">'
.
l
(
$link_title
,
$link_href
,
array
(
'html'
=>
'true'
))
.
'</li>'
;
$link_title
=
$link
[
'#title'
];
// We close the ul with class breadcrumb, as per design
$link_href
=
$link
[
'#href'
];
$html
.=
'</ul>'
;
$html
.=
'<li class="active">'
.
l
(
$link_title
,
$link_href
,
array
(
'html'
=>
'true'
))
.
'</li>'
;
}
// We close the ul with class breadcrumb, as per design
else
{
$html
.=
'</ul>'
;
// If it has children could be active or not.
}
// To check we need to create first the third level
else
{
// menu, and check if any of the third level menu links
// If it has children could be active or not.
// is active
// To check we need to create first the third level
list
(
$has_child_active_link
,
$third_level_menu
)
=
valencia_third_level_menu
(
$link
[
'#below'
]);
// menu, and check if any of the third level menu links
// is active
$link_title
=
$link
[
'#title'
];
list
(
$has_child_active_link
,
$third_level_menu
)
=
valencia_third_level_menu
(
$link
[
'#below'
]);
$link_href
=
$link
[
'#href'
];
$link_title
=
$link
[
'#title'
];
// If a child is active, this one isn't active
$link_href
=
$link
[
'#href'
];
if
(
$has_child_active_link
)
{
$html
.=
'<li>'
.
l
(
$link_title
,
$link_href
,
array
(
'html'
=>
'true'
))
.
' ›</li>'
;
// If a child is active, this one isn't active
}
if
(
$has_child_active_link
)
{
else
{
$html
.=
'<li>'
.
l
(
$link_title
,
$link_href
,
array
(
'html'
=>
'true'
))
.
' ›</li>'
;
$html
.=
'<li class="active">'
.
l
(
$link_title
,
$link_href
,
array
(
'html'
=>
'true'
))
.
'</li>'
;
}
}
else
{
$html
.=
'<li class="active">'
.
l
(
$link_title
,
$link_href
,
array
(
'html'
=>
'true'
))
.
'</li>'
;
// We close the ul with class breadcrumb, as per design
}
$html
.=
'</ul>'
;
// We close the ul with class breadcrumb, as per design
// Then, third level menu
$html
.=
'</ul>'
;
$html
.=
$third_level_menu
;
}
// Then, third level menu
}
$html
.=
$third_level_menu
;
}
}
}
}
}
}
}
}
return
$html
;
return
$html
;
}
}
/**
/**
...
...
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