Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
navigation
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
navigation
Commits
72df0418
Commit
72df0418
authored
Oct 18, 2023
by
Cristina Chumillas
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3390478
: Change weight
parent
457eb6d1
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!96
Issue #3390478: Change weight
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
navigation.module
+4
-1
4 additions, 1 deletion
navigation.module
src/Plugin/Navigation/NavigationAdmin.php
+1
-0
1 addition, 0 deletions
src/Plugin/Navigation/NavigationAdmin.php
templates/navigation.html.twig
+1
-3
1 addition, 3 deletions
templates/navigation.html.twig
with
6 additions
and
4 deletions
navigation.module
+
4
−
1
View file @
72df0418
<?php
use
Drupal\Component\Utility\SortArray
;
use
Drupal\Core\Url
;
/**
...
...
@@ -16,7 +17,9 @@ function navigation_preprocess_html(array &$variables) {
$menu
[
$definition
[
'region'
]][
$id
]
=
$instance
->
getMenuItems
();
$menu
[
$definition
[
'region'
]][
$id
][
'#weight'
]
=
$definition
[
'weight'
];
}
foreach
(
$menu
as
$region
=>
$region_data
)
{
uasort
(
$region_data
,
[
SortArray
::
class
,
'sortByWeightElement'
]);
}
$variables
[
'page_top'
][
'navigation'
]
=
[
'#theme'
=>
'navigation'
,
'#menu_middle'
=>
$menu
[
'middle'
],
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/Navigation/NavigationAdmin.php
+
1
−
0
View file @
72df0418
...
...
@@ -13,6 +13,7 @@ use Drupal\navigation\NavigationSectionInterface;
* id = "admin",
* title = "Administration",
* region = "middle",
* weight = 5,
* )
*/
class
NavigationAdmin
extends
PluginBase
implements
NavigationSectionInterface
{
...
...
This diff is collapsed.
Click to expand it.
templates/navigation.html.twig
+
1
−
3
View file @
72df0418
...
...
@@ -31,9 +31,7 @@
</div>
{{
menu_top
}}
{%
for
section
in
menu_middle
%}
{{
section
}}
{%
endfor
%}
{{
menu_middle
}}
</nav>
{# @todo - This sticky menu should exist under the <nav> landmark element above. #}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment