Create a link that will bring a user to their own profile

I would like to create a link that will tell members where to find their badges in their profile.

In this post I would like to direct members to their profile with a link.

For example: https://meta.discourse.org/users/YOUR-USERNAME-HERE/activity

Is it possible to do this in a post using markdown? Or what needs to be done to accomplish this?

3 Likes

This exists https://meta.discourse.org/my/activity

13 Likes

Wowowow! Thank you. This is the greatest thing.

1 Like

Can this same solution be used to direct to a users post in a category. eg: I want to encourage my users to create a progress log. I have a Discourse category for these logs so I can link to the category, but I wonder if I could link to their log directly and if they don’t have one it would fall back to the category page. AKA: how else can the /my/ function be applied?

1 Like

Like this ?
https://meta.discourse.org/t/my/11080/12
https://meta.discourse.org/t/my11080/12

1 Like

Not sure what I’m seeing here. Mostly due to my unfamiliarity with the URL structure Discourse uses. I get the /t/ part and /my refers to the user but what does /11080/12 indicate?

1 Like

Those are the topic_id and post_id

I guess I’m not understanding exactly what you’re asking?

1 Like

My is very restrictive and only applicable to certain pages, it can’t be used the way you are depicting. You’d have to write a plugin or something. It would be best to just send them to the category and they can find their existing log (if need be)

2 Likes

OK thanks and agreed, just sending to the category will work, I was just trying to be fancy. Thanks as well to @Mittineague for explaining the url structure. That will be useful info for the future.

1 Like

The ‘my’ there could be replaced by anything, including a single dash - it’s taking the place of the topic slug, and the server will 302 you to the correct URL.

4 Likes

And that is in reference to the one @mittineague created, not to be confused with the one that goes to their profile/preferences/bookmarks, etc.

2 Likes

Just to be clear, replace u/username (including the u/) with my for this to work.

1 Like

This topic was automatically closed after 3074 days. New replies are no longer allowed.