Override or change AboutPageUser

Hi!

I’m currently updating a theme component that’s going to be affected by upcoming core changes in Discourse (Removing support for "template overrides" and mobile-specific templates). In order to retain the customization we had, we need to change the html of the AboutPageUser component - about-page-user.gjs.

Is it possible to override the template in that file?

3 Likes

To change content in the UI, you should use our outlet system. If there isn’t an existing outlet which suits your use-case, then we’re generally happy to accept new outlets via a PR to discourse core.

What are you trying to do here? Add some extra content into AboutPageUser? Or replace the implementation entirely?

1 Like

We’re attempting to remove the link from the HTML template when the current user isn’t logged in. Previously, we had a condition to handle this with template override, but we haven’t found a corresponding way in the new API.

2 Likes

What’s the reason for removing the link? Is it because you have user profiles hidden from anonymous users?

2 Likes

Yes, we want it hidden from anonymous users.

Ok, makes sense! To be honest, this sounds like something we should change in Discourse core. Linking to user profiles when they’re hidden to anon doesn’t make sense.

I’ll take a look :eyes:

6 Likes

I just merged this commit which removes the user profile links from the topic-list, topic page and about page for anonymous users when hide_user_profiles_from_public is enabled.

Note that this is purely a UX change. Crawlers see a different version of the HTML. The nofollow directive was added to crawler-view user profile links back in January.

7 Likes

This topic was automatically closed after 20 hours. New replies are no longer allowed.