Start a topic by pasting a link (like Reddit)

Hmm yeah I don’t think that’s intended. But that raises the question of how to control whether you’re allowed to post featured link topics as uncategorized. I guess a new site setting for that. Wait I’m dumb. Uncategorized is a category and already has the setting. Will fix this.

Once you paste the link and the automatic stuff happens, you’re free to edit the post as much as you want. When you change the category to one that doesn’t allow links to be featured, then it means topic lists won’t give a shortcut to the external url. Do you think the composer fields should be cleared when changing the category?

4 Likes

I fixed permission to use featured links with uncategorized topics. You control it the same way as other categories.

3 Likes

I still think having some checkbox or other indicator that transparently shows whether the link will be featured is worth considering and might help for this scenario.

Oops. What I meant was the other way round. When a category doesn’t allow a topic link, the URL stays in the title even after you select a category that allows it.

Confusingly, when clicking “New Topic” from the homepage, I don’t get the option to paste a featured link. But I do if I choose a category. I haven’t changed any settings except to globally enable featured links. Is this a bug?

Hmm, that’s a case where your site doesn’t allow topics without a category. You’re being prompted to “Select a category…”, and form doesn’t know if featured links are allowed. In that case it should be fine to allow pasting a link.

Yeah makes sense that the composer should try to handle that case.

I love this feature!

I’ve written a browser plugin that allows users to click a toolbar button while browsing to share the page’s URL in a new Discourse topic. Unfortunately, it does not work when creating a pre-filled topic via URL.

3 Likes

Fix this case today. You can paste a link before choosing the category and get the onebox behaviour.

Added support for this today.

7 Likes

Does this work for any link?
I’m trying to make a new post with this link [http://gokifu.com/
] and nothing happens. Linking to youtube homepage doesn’t work either, but links to a video works.

Is it possible to edit/revise an existing topic so that it behaves in this Reddit-like fashion (i.e., so that it displays the external link in the topic list)?

1 Like

I just tried with a link to this topic and, like you describe, nothing happens. I copied:
https://meta.discourse.org/t/start-a-topic-by-pasting-a-link-like-reddit/54071?u=orajnam
into “Create a new topic” and it seemed to be ignored. Other links worked as expected and were oneboxed fine.

1 Like

I’ve also found that it doesn’t work for all links. For links that aren’t supported, the user ought to get some feedback rather than no response.

2 Likes

Hmm where did you try this?

I tested on try.discourse.org and it worked ok

https://try.discourse.org/t/start-a-topic-by-pasting-a-link-like-reddit/624

@codinghorror This feature does not seem to work if there is a template defined for the category. Pasting a link to topic title field does nothing.

The same link works in a category that does not have a template.

Hmm, does this conflict with templates @neil?

It doesn’t work with category topic templates. The body of the composer has something in it. Should the onebox happen and replace the body?

Maybe prepend? Replacing can be a bad surprise :smile:

2 Likes

https://forum.manjaro.org/t/new-discourse-feature-start-a-topic-by-pasting-a-link-like-reddit/16292?u=orajnam

Edit: When I tried a Youtube link on the same site it worked fine:

https://forum.manjaro.org/t/the-vulkan-graphics-api-what-it-means-for-linux/16329?u=orajnam

When I try pasting this URL into the title bar, it doesn’t get automatically pushed down:

http://writing.jan.io/2015/11/20/sustainable-open-source.html

And it’s not recognised as a link:

Same for https://opensource.guide, https://karissa.github.io/post/okf-de and What makes a good community? – Sage Sharp.

This one has no HTML <head> neither OpenGraph nor oEmbed support.

Facebook does the heavy lift for you, by using the first <h1> as a title, and a random content inside the firsts <p> as the description. It would also use the first <img> as the image, but this page has none.

I would love for Onebox to do the same, but I’m not sure if the risks (more resource use, more attack vectors) are worth it :thinking:.

This works for me.

This returns a 404 error with content, that’s crazy.

This one also doesn’t support OpenGraph, so it’s the same case as the first, we would need to do extra work.

4 Likes