Redirect on click user avatar and username to user profile page /u/username/summary

AI-generated summary

The discussion in the Dev category addresses how to redirect to a user’s profile page (e.g., /u/username/summary) when clicking on a user’s avatar or username, instead of opening a user card popup. Anil_Tako asked for a solution, and JammyDodger provided a JavaScript code snippet using Discourse’s API to modify the user card component, which successfully redirects to the profile summary. Anil_Tako confirmed that the solution resolved the issue.

How to redirect to user profile page i.e. u/username/summary when click on avatar and username instead of opening popup of user card?

Dev is not my strong suit, but I’ve asked the clever people and I believe something like this should be what you’re looking for: :+1: :slight_smile:

 api.modifyClass("component:user-card-contents", {
    pluginId: "your-plugin-id",
    _show(_, target) {
      DiscourseURL.routeTo(`${target.href}/summary`);
      return false;
    },
  });

Thanks! It solved the problem.