How to start app with menu on top bar

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
lnobs
Posts: 4
Joined: 2025-08-04 09:57
Location: Wentzville, MO USA
Contact:

How to start app with menu on top bar

Post by lnobs » 2025-08-11 15:54

I have table groups set up. When my application starts or when I click on the app name in the top left, the screen shows long horizontal bars layered in the middle of the screen for the menu. Once I click on a table form and the form loads, the classic menu bar appears at the top of the screen and works for navigation. I want the classic top menu bar to always be the menu that shows up whether at application start up or when clicking the app name in the top left.

saymaad
AppGini Super Hero
AppGini Super Hero
Posts: 55
Joined: 2024-06-03 16:17

Re: How to start app with menu on top bar

Post by saymaad » 2025-08-12 08:33

As of AppGini 24.14 you can display the navigation menus in the homepage by adding this code to the hooks/__bootstrap.php file inside a PHP block:

Code: Select all

define('HOMEPAGE_NAVMENUS', true);

lnobs
Posts: 4
Joined: 2025-08-04 09:57
Location: Wentzville, MO USA
Contact:

Re: How to start app with menu on top bar

Post by lnobs » 2025-08-12 17:50

@saymaad
This works.
With the added information referencing __bootstrap.php I was able to find another post on the same topic from @jsetzer
https://forums.appgini.com/phpbb/viewto ... php#p23480
and I used the code from there:
<?php
// file: hooks/__bootstrap.php
if (!defined('HOMEPAGE_NAVMENUS')) define('HOMEPAGE_NAVMENUS', true);

I have an additional question if anyone can assist. When the application launches I have the menus on the top navigation bar as I needed now, but the big buttons of the default navigation still appear in the middle of the page. I would like those big buttons to not appear at all. Would be nice to also add a simple welcome message or instructions instead on the page.

Thank you very much from this AppGini newbie.

saymaad
AppGini Super Hero
AppGini Super Hero
Posts: 55
Joined: 2024-06-03 16:17

Re: How to start app with menu on top bar

Post by saymaad » 2025-08-13 07:47

The easiest and most common way to get rid of those big home page buttons and replace them with a custom message is to use a simple JavaScript snippet within the hooks/header-extras.php file, this method is quick if you are not well versed with the programming languages. This approach uses jQuery to remove the existing elements and insert your new content.

Code: Select all

<?php
$script_name = basename($_SERVER['PHP_SELF']);
if ($script_name == 'index.php') {
?>
    <script>
        $j(function() {
            // Remove the collapsible sections and their headers
            $j('.collapse').remove();
            $j('.collapser').remove();
            
            // Add a custom welcome message and instructions
            $j('.users-area').append('<div class="jumbotron"><h1 class="display-4">Welcome to our Application!</h1><p class="lead">Here you can find all the tools you need to get started. Use the navigation bar above to explore.</p></div>');
        });
    </script>
<?php 
}
However, if you want to have complete control over the look and feel of the login and homepage, the more advanced method is to create hooks/home-custom.php. This file will completely replace the default homepage template as well the redirections to the login page, giving you a blank slate with only the navbar and footer to work with. This method is more powerful but requires a deeper understanding of AppGini's internal working (home.php in this case) PHP, HTML and CSS to rebuild the page layout from scratch.

lnobs
Posts: 4
Joined: 2025-08-04 09:57
Location: Wentzville, MO USA
Contact:

Re: How to start app with menu on top bar

Post by lnobs » 2025-08-15 17:05

@saymaad
That was very helpful. The top navigation bar was also blanked out. ai assisted me with the following code and it looks like "navbar-collapse" and "navbar-header" are valid names.

Thanks again, so much to learn.

Code: Select all

<?php
$script_name = basename($_SERVER['PHP_SELF']);
if ($script_name == 'index.php') {
?>
    <script>
        $j(function() {
            // Remove only the specific elements for the big buttons
            $j('.collapse').not('.navbar-collapse').remove(); // Keep the navbar intact
            $j('.collapser').not('.navbar-header').remove(); // Keep the navbar intact
            
            // Add a custom welcome message and instructions
            $j('.users-area').append('<div class="jumbotron"><h1 class="display-4">Welcome to our Application!</h1><p class="lead">Here you can find all the tools you need to get started. Use the navigation bar above to explore.</p></div>');
        });
    </script>
<?php 
}

User avatar
a.gneady
Site Admin
Posts: 1354
Joined: 2012-09-27 14:46
Contact:

Re: How to start app with menu on top bar

Post by a.gneady » 2025-08-23 11:31

Please beware that the code suggested here might break the new vertical navigation menu added since AppGini 25.13. If the desired effect is to remove the homepage links, try adjusting lines 7 to 9 of the above code to:

Code: Select all

// Remove only the specific elements for the big buttons
$j('.homepage-links .collapse').remove();
$j('.homepage-links .collapser').remove();
:idea: AppGini plugins to add more power to your apps:

lnobs
Posts: 4
Joined: 2025-08-04 09:57
Location: Wentzville, MO USA
Contact:

Re: How to start app with menu on top bar

Post by lnobs » 2025-08-23 16:32

@saymaad @a.gneady

It does look like Ahmed's code is necessary to prevent vertical navigation menu failures.

Post Reply