Links category is going to be a core feature. Links category offers the ability to post a link instead of text as well as displaying the link in the topic list. I’ll work together with the team for all its features. All features shall be working as original after the transition.
It adds an option in the category settings to be enabled. It stores links in the topic’s custom fields. A customized composer which shows only a small input field instead of original one is used to post link topics. The digest email template is also overrided for displaying url.
The implementation of plugins overrides many spots of core model which looks quite awkward to merge directly. I believe another archetype is much promising to try in the new implementation as described here. But that should result in a lot of changes in composer model and post creator. I’d like to know whether it’s the right path to go. @team
@team I think Erick is blocked on this without any feedback since he needs to know whether archetypes is the way to go or not before doing any significant work.
I personally would rather prioritize this than Feature Voting, as it is more broadly useful to any Discourse site. But we’ll need to pick one – we don’t have anyone else to allocate at the moment.
If archetype is an expensive way to go, I can still merge the plugin in the core with the same implementation. It could be a bit messy in code. But I can improve later.
This should actually be merged into core, I don’t think this should be a plugin at all. Sharing a link and inviting discussion on that link is an essential feature for all Discourse instances.
We’ll need to allocate someone for this work in the next few weeks.
Sorry for my communication. I have arrived Sweden and there were things unexpected in the way I will make some progress this week.
The code simply uses topic custom field so there are monkey patches in the ComposerController. And I also patched Topic and Composer model. To be merged to core with less work, sounds another model like Warning can do the trick.
As @sam asked, I will look for a way to extend Ember models to carry the field.
Well, a short progress report. It’s far more easy to inject the field in the core than writing this in a plugin. So far, using TopicCustomField is quite OK to make needed changes. Let me know if it conflicts anything.
Finally, the pull request is ready. It’s enabled by default for all topics if topic_featured_link setting is checked. However, there is a per-category’s option to restrict editing.
The link is still stored in TopicCustomField which should be easy to migrate. There are some break changes. So I create a new plugin for those extra bits. This plugin can apply additional styles for links in digest email. Also there is a topic_featured_link_extra_link_ref for adding a ref parameters after the link. I’ll add showing onebox in the post body later.
OK, I’ll remove link-only option. The empty body (without onebox) is the origin spec from @commonpawn since they are using a different design. It’s also easy to hide post body in CSS.
http://danskdynamit.com/ shows a button for clicking the links. It’s obvious as of functionality. But it’s too large for the official theme.
The only thing I am afraid is that it might be hard for beginners to find the comment area.