I’m adding a custom link to the navigation menu. When I add a value that exceeds the # of table groups, it creates its own group, which is great, but it doesn’t have a header title. Is their syntax within the array section that would create a title for that additional stand-alone table group? Thank you. V/r,
// file: hooks/links-navmenu.php (syntax below is intentionally abbreviated for the purposes of this post)
$navLinks[] = array(
'url' => 'hooks/summary-reports-list.php',
'title' => 'XXXX',
'groups' => array('*'),
'icon' => 'hooks/summary_reports-logo-md.png',
'table_group' => 4, // optional index of table group, default is 0,
);
Adding Extra Links to NavMenu
-
- Veteran Member
- Posts: 32
- Joined: 2020-06-22 00:00
Adding Extra Links to NavMenu
- Attachments
-
- 2.PNG (16.29 KiB) Viewed 2553 times
Re: Adding Extra Links to NavMenu
Hi,
I would not know of any option to set this directly.
But you could add the following to the hooks/footer-extras.php
I would not know of any option to set this directly.
But you could add the following to the hooks/footer-extras.php
Code: Select all
<script>
$j('.nav .dropdown-toggle:last').html('YOURLABLEHERE'+$j('.nav .dropdown-toggle:last').html());
</script>
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
- Veteran Member
- Posts: 32
- Joined: 2020-06-22 00:00
Re: Adding Extra Links to NavMenu
Pböttcher,
Thank you for your assist!
It appears to be working, except it appends the title to the last title as you can see in the enclosed pictures. I will try to play around with it, but if you should come up with an alternate solution, please send it my way. Thank you again!
V/r,
Thank you for your assist!
It appears to be working, except it appends the title to the last title as you can see in the enclosed pictures. I will try to play around with it, but if you should come up with an alternate solution, please send it my way. Thank you again!
V/r,
- Attachments
-
- 1.png (124.71 KiB) Viewed 2536 times
Re: Adding Extra Links to NavMenu
Hi,
I'm missing the "empty" group (with no title) in the screenshot.
The script is minimal and assumes you have added the extra nav-link to a non-existing group as you described in the use case.
I'm missing the "empty" group (with no title) in the screenshot.
The script is minimal and assumes you have added the extra nav-link to a non-existing group as you described in the use case.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Adding Extra Links to NavMenu
Hi,
You could play with incCommon.php (be aware that everytime you regenerate code you need to avoid replacing this file if you modify it).
To add your custom menu like the other navmenus (aligned to the left), look for function NavMenus().
You need to add your html code to the $menu_wrapper variable... something like
Also in the NavMenus() I played with adding a new Table Group Name to the array . Just push a new item to the array:
, I don't remember exactly why I finally didn't use this for my case... but I remember that I was able to show the menu, only if it's not empty. There's a script in common.js.php that delete the empty menu groups.
You could also add it to the "right", adding it to the HtmlUserBar() function.
Right after (visible in desktop mode)
and after (visible in collapsed navbar)
This will show to the left of the "Logged in as".
I hope this gives you a hint on how you could solve your problem.
Saludos,
Hernan.
You could play with incCommon.php (be aware that everytime you regenerate code you need to avoid replacing this file if you modify it).
To add your custom menu like the other navmenus (aligned to the left), look for function NavMenus().
You need to add your html code to the $menu_wrapper variable... something like
Code: Select all
...
$menu_wrapper .= "<li class='dropdown'>
<a href='#' class='dropdown-toggle' data-toggle='dropdown'>MENU HEADER<b class="caret"></b></a>
</li>"
return $menu_wrapper;
}
Code: Select all
$table_group_name
Code: Select all
$table_group_name = array_keys(get_table_groups()); /* 0 => group1, 1 => group2 .. */
array_push($table_group_name, "Custom Menu Title")
...
You could also add it to the "right", adding it to the HtmlUserBar() function.
Right after (visible in desktop mode)
Code: Select all
<ul class="nav navbar-nav navbar-right hidden-xs">
Code: Select all
<ul class="nav navbar-nav visible-xs">
Saludos,
Hernan.
-
- Veteran Member
- Posts: 32
- Joined: 2020-06-22 00:00
Re: Adding Extra Links to NavMenu
pböttcher and Hernan,
Thank you very much for your feedback. I didn't get any alerts from my email about post replies, so sorry about the delayed response.
I will definitely give your recommendations a try using a careful and methodical approach. I will let you know how it turns out. Thank you again for your support!
V/r,
Thank you very much for your feedback. I didn't get any alerts from my email about post replies, so sorry about the delayed response.
I will definitely give your recommendations a try using a careful and methodical approach. I will let you know how it turns out. Thank you again for your support!
V/r,