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) {
* Also, if there is, we print third level menu
*/
function
valencia_breadcrumb_menu
(
$vars
)
{
// Var with all HTML
$html
=
''
;
foreach
(
$vars
[
'links'
]
as
$key
=>
$link
)
{
// See Drupal API, is to print every menu voice only one
if
(
is_numeric
(
$key
))
{
// We need only active links
if
(
$link
[
'#original_link'
][
'in_active_trail'
])
{
// If is the first level link and it has children, we start to create the breadcrumb
if
(
!
empty
(
$link
[
'#below'
])
&&
$link
[
'#original_link'
][
'depth'
]
===
'1'
)
{
$html
.=
'<ul class="breadcrumb">'
;
// Now we need to attach second level menu
$sub_menu
=
theme
(
'links__system_main_menu'
,
array
(
'links'
=>
$link
[
'#below'
],
'id'
=>
'breadcrumb'
));
$html
.=
$sub_menu
;
}
// Second level link: could be the active one, or only a
// breadcrumb for third level (or both)
else
if
(
$link
[
'#original_link'
][
'depth'
]
===
'2'
)
{
// If it hasn't child, is the active link
if
(
empty
(
$link
[
'#below'
]))
{
$link_title
=
$link
[
'#title'
];
$link_href
=
$link
[
'#href'
];
$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>'
;
}
else
{
// If it has children could be active or not.
// To check we need to create first the third level
// menu, and check if any of the third level menu links
// is active
list
(
$has_child_active_link
,
$third_level_menu
)
=
valencia_third_level_menu
(
$link
[
'#below'
]);
$link_title
=
$link
[
'#title'
];
$link_href
=
$link
[
'#href'
];
// If a child is active, this one isn't active
if
(
$has_child_active_link
)
{
$html
.=
'<li>'
.
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>'
;
// Then, third level menu
$html
.=
$third_level_menu
;
}
}
}
}
}
// Var with all HTML
$html
=
''
;
foreach
(
$vars
[
'links'
]
as
$key
=>
$link
)
{
// See Drupal API, is to print every menu voice only one
if
(
is_numeric
(
$key
))
{
// We need only active links, and we don't want the
// news page
if
(
$link
[
'#original_link'
][
'in_active_trail'
]
&&
$link
[
'#title'
]
!==
'News'
)
{
// If is the first level link and it has children,
// we start to create the breadcrumb
if
(
!
empty
(
$link
[
'#below'
])
&&
$link
[
'#original_link'
][
'depth'
]
===
'1'
)
{
$html
.=
'<ul class="breadcrumb">'
;
// Now we need to attach second level menu
$sub_menu
=
theme
(
'links__system_main_menu'
,
array
(
'links'
=>
$link
[
'#below'
],
'id'
=>
'breadcrumb'
));
$html
.=
$sub_menu
;
}
// Second level link: could be the active one, or only a
// breadcrumb for third level (or both)
else
if
(
$link
[
'#original_link'
][
'depth'
]
===
'2'
)
{
// If it hasn't child, is the active link
if
(
empty
(
$link
[
'#below'
]))
{
$link_title
=
$link
[
'#title'
];
$link_href
=
$link
[
'#href'
];
$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>'
;
}
else
{
// If it has children could be active or not.
// To check we need to create first the third level
// menu, and check if any of the third level menu links
// is active
list
(
$has_child_active_link
,
$third_level_menu
)
=
valencia_third_level_menu
(
$link
[
'#below'
]);
$link_title
=
$link
[
'#title'
];
$link_href
=
$link
[
'#href'
];
// If a child is active, this one isn't active
if
(
$has_child_active_link
)
{
$html
.=
'<li>'
.
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>'
;
// 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