Turn off navbar if user not signed in

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
bdurfee
Veteran Member
Posts: 32
Joined: 2013-02-07 17:44

Turn off navbar if user not signed in

Post by bdurfee » 2017-08-03 16:47

I want to turn off the navbar if the user is not signed in. What is the best way to do this?

bdurfee
Veteran Member
Posts: 32
Joined: 2013-02-07 17:44

Re: Turn off navbar if user not signed in

Post by bdurfee » 2017-08-03 18:57

I found a quick way to do this. Add this just before the <body> tag.

Code: Select all

<?php 
	$mi = getMemberInfo();
	if(!$mi['username'] || $mi['username'] == 'guest'){ ?>
		<style>
			.navbar-fixed-top {
				min-height: 0px;
				display: none;
			}
		</style>
<?php } ?>
Comments welcome.

Post Reply