0

Let's say you have a website / app where there are user pages, and on the user page there are additional links for things like that user's awards or posts. Something like this:

enter image description here

The issue I'm having is that currently I don't have back buttons, so if someone is linked directly to the /users/5/awards page, there is no way for someone to go to /users/5 and see that person's profile, outside of manually editing the URL.

Okay, simple enough, add a "Back to profile" link on the ./awards and ./posts route, but the problem with that is sometimes users will be directly linked to a post and then click a user to go to their profile, and then click to see their awards. Then if they click the "Back to profile" button, and then use their browser back button, it will take them back to the person's awards instead of going back to the post.

And I can't have a "Back" button on the profile page, because someone could have came from a post, the users page, or something else.

I was thinking about manually saving the routing history of each user, and then having Back buttons sometimes execute history.go(-1) if the previous route is the same as the href of the link, and otherwise being a direct link, but I'm not sure if that is confusing.

What is a good way to handle this? If someone is directly linked to someone's awards, I want a way for that person to be able to go to their profile, but the existence of these buttons interfere with existing routing, because some routes (like the user page), have multiple ways of getting to them, so they can't have a static "Go Back" link.

1
  • Just use breadcrumbs, they're specifically designed for your use case
    – Devin
    Apr 20 at 15:51

1 Answer 1

1

With breadcrumbs:

Home > Users > Ryan      (breadcrumb trail)

AWARDS                   (page title)
------

(rest of page)

you avoid having to keep track of the state of your buttons and don't have any ambiguity: Clicking on the username will always go back to the user.

On mobile, the full breadcrumb typically isn't displayed, but instead the page title with a title bar is given a back arrow:

< Awards

tapping the arrow puts you one level up (to Ryan), where the title bar now reads "< Ryan". Another tap back would get you to Users, another to Home. In Home, finally, the arrow would disappear (or, more likely: be replaced by a hamburger menu).

A stateful back button on the website is probably not necessary as the browser - and especially a mobile device - has one of those already.

3
  • Doesn't really work on mobile. The breadcrumbs are too long and don't really fit the style of the site. I don't really know any mobile sites that use breadcrumbs. Most designers say it's an anti-pattern Apr 26 at 19:01
  • I have updated my answer for the case of mobile; it's still essentially breadcrumbs but not displayed all at the same time. I cannot verify your claim that "most sites say [breadcrumbs are] an anti-pattern", in fact, I can't find any source at all saying it is. Apr 26 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.