Jump to content

Hide full navbar when a user is not logged in


Recommended Posts

Hi there,

I am wanting to hide the WHMCS navbar from users if they are not logged in. I want to hide the full navbar and not just an item. I know I need to use a hook however I am not sure what hook and which file to include it in.

Attached is an image of my navbar with an arrow to the section I want to hide. I believe this is called the Primary Navbar? It is the bottom nav out of the two anyway!

Thanks for any help.

- Hayden

Screenshot 2018-11-16 at 12.35.43.png

Link to comment
Share on other sites

Hi Hayden,

On 16/11/2018 at 12:38, tigerstripemedia said:

I am wanting to hide the WHMCS navbar from users if they are not logged in. I want to hide the full navbar and not just an item. I know I need to use a hook however I am not sure what hook and which file to include it in.

I assume that you've solved already this as i'm not seeing it on your site...

On 16/11/2018 at 12:38, tigerstripemedia said:

Attached is an image of my navbar with an arrow to the section I want to hide. I believe this is called the Primary Navbar? It is the bottom nav out of the two anyway! 

primary navbar on the left (Portal Home), secondary navbar (Account) on the right... and then it comes down to what you mean by hiding... just removing the links from the primary navbar? do the same for the secondary ?? hide the entire bar ???

the answer to those would tell you how to do it... first two would be hooks; third could be done by a variety of methods.

Link to comment
Share on other sites

Hi Brian,

Thanks for replying. Yes I managed to resolve it, sorry I forgot to come and update this.

Thanks also for pointing out the typo on my coming soon page. Corrected that now.

I wanted to hide the entire bar when the user is logged out. I now have a link to login and a link to view the cart in the very top navigation bar and then the second navbar appears when users login. Please see screenshots attached. Works perfectly however I am not sure I did the the "correct" way. I added an if statement to my header.tpl file within my custom template:

{if $loggedin}

	<section id="main-menu">
      
      Content goes here
      
	</section>

{/if}

If there is a better way of doing this, suggestions would be welcome!

Thanks, Hayden

Screenshot 2018-11-18 at 11.57.28.png

Screenshot 2018-11-18 at 11.58.42.png

Link to comment
Share on other sites

On 18/11/2018 at 12:02, tigerstripemedia said:

If there is a better way of doing this, suggestions would be welcome!

your way is the way that I would have done it... whether that means it's the "correct" way I don't know, but it's the simplest method that will achieve the desired outcome. thanks.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated