Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Abigail Wentzel
Abigail Wentzel
4,136 Points

Need to build a dynamic navigation bar, with specific links based on the user.

I need the navigation to show one set of links for existing customers, and another set for visitors. I realize I can code this with PHP using permissions, but that's only helpful if the user logs in to their profile. Plus, if their session times out then they're back to the visitor navigation.

Instead, I'd like the navigation to stay consistent 100% of the time as soon as they land on the site. Is there a way to set up tracking to achieve this? And then how would I code the "view on/off" for the navigation?

Unless someone has a very compelling argument I can take to my boss(es) to talk them out of dumping every single link for existing customers in the primary navigation bar? Especially when the primary purpose of the website is lead generation (and these links are NOT relevant to incoming leads). And most especially when they only generated a 1.17% click-through rate? /rant

2 Answers

David Clausen
David Clausen
11,403 Points

You can do this by cookies, IP tracking and log-in session. They are all valid. Using a combination of all three is your best bet. But remember you are exposing your client more when you only require one. Say someone else uses that IP, or they reget cookies. Forcing a customer to have his information logged somewhere where they can't actively block or prevent it is considered somewhat malicious and a privacy concern.

There is a reasonable expectation when someone closes their browser there logged of their website. A remember me check mark then can record the cookie and ip to allow for auto-login when visiting your site.

http://stackoverflow.com/questions/1354999/keep-me-logged-in-the-best-approach

Cookie is important because if someone logs into the computer under another account then the IP is checked but the cookie isnt, requiring a log in for the new user.

Abigail Wentzel
Abigail Wentzel
4,136 Points

Well, I'm trying to find a workaround / compromise with these links. We just launched updated navigation 2 weeks ago. The links in question are now one level down, in a submenu rather than the primary nav bar. Suddenly my boss is getting "numerous" calls from "disgruntled" people saying they can't find a particular page anymore. Of course, he can't give me an exact number or tell me who the users are.

I'm not saying I'm fine with unhappy or confused users. The point of the navigation update in the first place was to make it cleaner, clearer and more mobile-user friendly. It went from 10+ unrelated and unprioritized links to 4, now reorganized into appropriate categories.

It's just that the reporting and analysis shows that these are outliers, not the norm. I'm trying to convince them that the nav update is too new to start making major changes to it. I want to continue to monitor the behavior and see if it differs from the prior navigation (more clicks, less clicks, more conversions, etc)

Plus, do we really want to reverse the update simply to satisfy a very small minority of users (maybe 0.5%)?

David Clausen
David Clausen
11,403 Points

Sounds like more clicks, if its a sub level down. Its like opening a draw and then opening another draw inside the other to find what you previously had to just open one draw for. That's what makes media queries nice, on a desktop you could have all 10 links and still look clean and on mobile you could have 4.

But it sounds like your just venting so i don't have an answer for you. Goodluck

Abigail Wentzel
Abigail Wentzel
4,136 Points

Well, yes. I am. :)

In reality, it's only one click difference. Before it was a "primary" link in the nav bar (1st level). Now it's a submenu item (2nd level), so you click a primary link, pull up submenu, click on the link.

The issue as far as desktop vs. mobile before was that there were so many "primary" links in the nav bar I was having issues with my responsive grid wrapping text once the max-width of the nav container was reached. Essentially, I was forced to add so many links they broke the container limits. On mobile, the menu (when opened) was a long scrolling list of links. Yikes!

So yes, I could hide the links desktop vs. mobile and I've done so in the past. Unfortunately the boss feels that they shouldn't be hidden at all...

David Clausen
David Clausen
11,403 Points

End of the day, its what your boss wants not your ego. It unfortunate cause you are probably right. A bootstrap side menu that pops out with all the links might be your best comprise mobile wise. They get all the link when they hit the button and no submenu. Give your boss his 10,000 menus back.