Creating a Custom menu item

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
User avatar
RonP
Veteran Member
Posts:319
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Creating a Custom menu item

Post by RonP » 2026-08-16 16:30

customer menu.png
customer menu.png (5.7 KiB) Viewed 2998 times
Hi,

I like to create a custom Menu Item, named: Documentation.
I've edit links-nav-menu.php however the result presents as a "sub menu" ( I have 2 table groups)

Code: Select all

/* Documentatie */
		$navLinks[] = [
			'url' => 'hooks/Gebruik-Warmtepompmonitor-applicatie.pdf', 
			'title' => 'Documentatie', 
			'groups' => ['*'], // groups allowed to see this link, use '*' if you want to show the link to all groups
			
			'table_group' => 1, // optional index of table group, default is 0
		];
	 
How can I change that, see screendump
And...document has to open in a new window
Ron

User avatar
jfischer
Veteran Member
Posts:34
Joined: 2022-11-19 16:07
Location: Austria
Contact:

Re: Creating a Custom menu item

Post by jfischer » 2026-08-17 05:34

Hallo Ron

Perhaps this will help you, Ron:

Code: Select all

<!-- file: hooks/header-extras.php -->
<script>
// ...
dropdown.addLink("text", "href", "icon");
// optional 4th parameter: target (string), for example "_self", "_blank", "tab_name"
// ...
</script>
The code is from Jan!

Best regards, Josef

PS: siehe hier: https://www.appgini.de/docs/Javascript- ... tom-search

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts:1757
Joined: 2018-04-01 10:12

Re: Creating a Custom menu item

Post by pbottcher » 2026-08-19 11:39

Hi Ron,

are you sure you have 2 tablegroups? It looks like there is only one and with the
'table_group' => 1,
the "empty" one is created.

best
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.

User avatar
RonP
Veteran Member
Posts:319
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Creating a Custom menu item

Post by RonP » 2026-08-19 13:02

Hi Pbottcher,
I have 2 tablegroups.
I know have a working link to a new sccreen, I've followd suggestion given by Josef.
However I stil don't see the wanted menu in top of screen
Attachments
wanted_menu_display.png
wanted_menu_display.png (79.46 KiB) Viewed 2955 times
tablegroups.png
tablegroups.png (30.04 KiB) Viewed 2955 times

User avatar
RonP
Veteran Member
Posts:319
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Creating a Custom menu item

Post by RonP » 2026-08-30 07:23

Hi,
Some suggestions?
Ron

User avatar
RonP
Veteran Member
Posts:319
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Creating a Custom menu item

Post by RonP » 2026-09-10 12:31

Well,
I've found the solution:

Code: Select all

// hooks/header-extras.php

?>
<script>
$j(function() {
    // find the brand link that contains "Application name"
    var $brand = $j('nav.navbar .navbar-brand').filter(function() {
        return $j(this).text().indexOf('Application name') !== -1;
    }).first();

    if(!$brand.length) return; // brand not found, do nothing

    // create Help link
    var $helpLink = $j(
        '<a class="navbar-brand" href="hooks/Documentname.pdf" target="_blank">Documentation</a>'
    );

    // insert Help link right after the Applicatio[attachment=0]menu.png[/attachment]n name brand link
    $brand.after($helpLink);
});
</script>
Attachments
menu.png
menu.png (26.07 KiB) Viewed 2423 times

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts:1757
Joined: 2018-04-01 10:12

Re: Creating a Custom menu item

Post by pbottcher » 2026-09-10 17:35

Hi Ron,

there is an option to add

Code: Select all

<?php define('HOMEPAGE_NAVMENUS', true); ?>

to the hooks/__bootstrap.php file (create it if it does not exist).
That would show all menu items-
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.

Post Reply