How to start app with menu on top bar
How to start app with menu on top bar
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.
Re: How to start app with menu on top bar
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);
Re: How to start app with menu on top bar
@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.
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.
Re: How to start app with menu on top bar
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
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/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
}
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.Re: How to start app with menu on top bar
@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.
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
}
Re: How to start app with menu on top bar
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();

- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
- Need personalized consulting on your specific app and customizations? Book an online call with me here.
Re: How to start app with menu on top bar
@saymaad @a.gneady
It does look like Ahmed's code is necessary to prevent vertical navigation menu failures.
It does look like Ahmed's code is necessary to prevent vertical navigation menu failures.