Add a link button or arbitrary text at any plugin outlet. (Ignore the watermarks in the images–I took these screenshots on a staging/test site.)
To see where the plugin outlets are, use Introducing Discourse developer toolbar to find them. If you don’t know what a plugin outlet is, you can have a look at Using Plugin Outlet Connectors from a Theme or Plugin, but this component allows you, with some restrictions, stick text in any plugin outlet without doing programming or really understanding what a plugin outlet is.
I started developing this plugin for someone who wanted to display a “click this button to subscribe so that you can send PMs” button on user profiles and user cards. They wanted the button to display if the user couldn’t send PMs. Because I’m not always as clever as I’d like to think, I wrote the component using groups to determine whether the button was displayed. One problem with this approach was that staff members weren’t in the subscriber group, so they’d get the “you gotta subscribe” button even though they could send PMs. Also, the group was hidden, so it was impossible to use it in a theme component anyway. I re-wrote that theme component to use currentUser.can_send_private_messages to determine whether to display the button.
Who is this for?
If you want to put a button with a link in it, or some arbitrary text that is displayed or hidden for certain groups, this will let you insert them at any plugin outlet. You want to add a “You outa subscribe” link button between every message except for those who aren’t members? This will do it. You want to stick some arbitrary HTML at a plugin outlet, just to see what it’ll look like? This will do that.
use api.renderInOutlet (as described here to stick a Glimmer component at an outlet controlled by a setting rather than creating a file in the connectors directory
We want to add such a set of buttons to every topic for members in our business account user group.
The button would then trigger creating a new PM which then includes the current URL the user is on
That way our business customers can send us request to pin, highlight or “sponsor” speficic topics
As you know, you can create a URL that will open a new topic composer. You could make that be the link added by the theme component.
I don’t think that it’s possible to do that without adding code to the theme component (but maybe it is?). Maybe someone has an idea about that and will offer that solution here (or on the other topic). If not, you can contact me or post in Marketplace with the description of what you need and a budget.