Page 1 of 1
Adding New Buttons to Top Header
Posted: 2015-12-17 15:46
by TheNoLifer
Hey All,
Does anyone know where to edit the very top header bar. I've tried the header-extras.php hook and other places - can't figure out where this is built from. I have seen screenshots of other folk's applications with extra buttons up here - so I know it's possible.
Trying to insert buttons to the right (or possibly Left) of the Sign In.

- new_buttons.PNG (23.64 KiB) Viewed 9452 times
Thank you!
Re: Adding New Buttons to Top Header
Posted: 2015-12-18 06:27
by peebee
The "Sign In" button is generated in incCommon.php
It will depend on which version of AppGini you are using but in the new V5.5.0 it's the <ul> around line 334 to 362
Look for code around there starting with <ul class="nav navbar-nav">
You should be able to add your additional button in there.
Re: Adding New Buttons to Top Header
Posted: 2015-12-18 14:28
by TheNoLifer
Thanks Peebee! That's it!

- test_button.PNG (33.37 KiB) Viewed 9428 times
For future reference and people looking to do the same, here is the specific section in the inCommon.php;
Code: Select all
<?php if(!$_GET['signIn'] && !$_GET['loginFailed']){ ?>
<?php if(getLoggedMemberID() == $adminConfig['anonymousMember']){ ?>
<a href="index.php?signIn=1" class="btn btn-success navbar-btn navbar-right"><?php echo $Translation['sign in']; ?></a>
<a href="SOME LINK" class="btn btn-success navbar-btn navbar-right">Test Button</a>
<p class="navbar-text navbar-right">
<?php echo $Translation['not signed in']; ?>
</p>
<?php }else{ ?>
<a class="btn navbar-btn btn-default navbar-right" href="index.php?signOut=1"><i class="glyphicon glyphicon-log-out"></i> <?php echo $Translation['sign out']; ?
></a>
Cheers
Re: Adding New Buttons to Top Header
Posted: 2019-09-20 23:55
by jmcgov
Try this in the hooks/header-extra.php file, before the PHP open tag
Code: Select all
<script>
$j(function(){
$j('.navbar-btn').parent().prepend('<a class="btn navbar-btn btn-danger" href="https://www.URL.co.uk/contact-us"><i class="glyphicon glyphicon-envelope"></i> Help Me</a>');
});
</script>
Re: Adding New Buttons to Top Header
Posted: 2020-11-28 18:55
by federico
jmcgov wrote: ↑2019-09-20 23:55
Try this in the hooks/header-extra.php file, before the PHP open tag
Code: Select all
<script>
$j(function(){
$j('.navbar-btn').parent().prepend('<a class="btn navbar-btn btn-danger" href="https://www.URL.co.uk/contact-us"><i class="glyphicon glyphicon-envelope"></i> Help Me</a>');
});
</script>
Hi
I'm trying to insert this but links appear repeated close to every button. I just need only one link
How can I fix it?
thanks
Re: Adding New Buttons to Top Header
Posted: 2020-11-28 20:19
by pbottcher
Try
Code: Select all
<script>
$j(function(){
$j('.navbar .navbar-right').prepend('<a class="btn navbar-btn btn-danger" href="https://www.URL.co.uk/contact-us"><i class="glyphicon glyphicon-envelope"></i> Help Me</a>');
});
</script>
Re: Adding New Buttons to Top Header
Posted: 2020-12-01 15:36
by federico
ahhh 2 links still remain...
PS there's also a list where I can get the icons? They are very nice
Re: Adding New Buttons to Top Header
Posted: 2020-12-01 15:56
by jsetzer
Re: Adding New Buttons to Top Header
Posted: 2020-12-01 16:02
by federico
Re: Adding New Buttons to Top Header
Posted: 2020-12-01 16:49
by pbottcher
try
<script>
$j(function(){
$j('ul.nav.navbar-nav.navbar-right.hidden-xs').prepend('<a class="btn navbar-btn btn-danger" href="
https://www.URL.co.uk/contact-us"><i class="glyphicon glyphicon-envelope"></i> Help Me</a>');
});
</script>
Re: Adding New Buttons to Top Header
Posted: 2020-12-01 16:51
by federico
It works! thank you very much pböttcher!!!
Re: Adding New Buttons to Top Header
Posted: 2020-12-10 15:28
by mwilliam
pbottcher, how would you do that code with a pop out window, or better known as a new window
Re: Adding New Buttons to Top Header
Posted: 2020-12-10 18:29
by pfrumkin
Have you tried
in the anchor tag (<a>)?
That is a new window, not a pop up.
~Paul