Share Link Shortener

Thank you so much for making this very useful theme component <3

4 Likes

I noticed a slight issue. The checkbox creation prevents the link text input content from being selected by default, and unfortunately, I don’t know how to fix it…

That’s a minor issue though. :slight_smile:

2 Likes

Shouldn’t the shortened link also include slug placeholder like this:

https://meta.discourse.org/t/-/251965/4

I’m pretty sure there used to be issues when linking to the forum from external sites using the shortened link without the slug?

3 Likes

I’m not aware of these issues.

I remember seeing the formatting without any slug in a piece of official code yesterday or the day before… I don’t remember where but I thought “how, they use the syntax without the /-/ here” which seemed to be a clue that such URLs seem to be fine. :thinking:

If you happen to find a link about potential problems, that would be great :+1:

2 Likes
1 Like

Thanks!

Either I’m not understanding the issue, or it’s not happening anymore. :slight_smile:

Clicking https://meta.discourse.org/t/1 opens the right topic seamlessly and allows you to go back to the previous URL.

No issue either with external links: https://unicyclist.com/t/265354/2608

2 Likes

That link ia almost 2 years old now. I imagine that may have been fixed up since then.

If you look at the op statement it was more about a post number.

The top link has /1 where as the other just ends in / so no post number in the link

(Share Link Shortener) This link goes to post #1 in this topic.

https://meta.discourse.org/t/251965/1

(Share Link Shortener) This link has no post number.

https://meta.discourse.org/t/251965/
2 Likes

You can add more customization to use external shortlink systems, for example I am currently using yourl source code to set-up a website that supports shortlink is https://agentc.asia/s

I loved so much what you did
but I needed to put an icon next to the date
to signal to users that they can click
How do I put an icon there?

@Canapin

1 Like

This suddenly stopped working on my site (to be honest I have no idea when, I don’t use it frequently) but just noticed now it’s not appearing on any of my themes though it’s still enabled on all of them. I know that provides no useful information lol, but any idea?

After upgrading to the latest version of Discourse, I confirm the component doesn’t work anymore.
I’d need to have a look at the recent Discourse commits.

It’s a very simple theme component, so if someone wants to have a look and do a PR, it’s also welcomed. :slight_smile:

1 Like

This seems like a useful component, so I’ve fixed it and added some updates here:

image

6 Likes

The theme component has been updated and is now official. :slight_smile:
There’s a new setting as well described in the first post.

I’ve been using Mastodon recently on an instance with limited character numbers, so that might be useful here indeed. :smile:

2 Likes

Shoud these two shares, topic and post, work similar way?

2 Likes
  1. Post link : yes, it does.

  2. Topic link… It triggers a JS error :scream: Thanks for thinking about that @Jagster :+1:

1 Like

Interesting, kind of. An error opens sharing of iOS instead. Well, not sharing-sharing actually, but this pop-up:

After trying again, it doesn’t trigger any error anymore.

I’m not sure what the issue was.

I don’t know anything about errors, but I get different view, and I don’t know if it should or should not be that way.

1 Like

On iOS the post share uses the operating system’s share modal, and the topic share uses the Discourse modal. I’m not 100% sure the reason, but I think it is because the topic share has the invite button as well and we don’t want to lose that?

The JS error is unrelated, I’ll have a fix in soon (fixed in FIX: check is post exists (#2) · discourse/discourse-share-link-shortener@3d31c99 · GitHub).

2 Likes

How’s androids, windows etc? The main reason for my curiosity is I’m writing helps for my users :wink: