Botão Copiar e Colar Código como Recurso Selecionável por Grupo

I am proposing the feature to have copy and paste code block buttons as designated feature per group. The use case is to incentivize subscriptions via ease of use features for an open source code documentation that is 100% open but is designing for subscriptions instead of sponsorships and advertisements for monetization.

I see it as a more open move than the private group preview to others option. I want everyone to be able to see it, but for there to be friction to copy and paste code from documentation if someone has not signed up.

1 curtida

Hello and welcome to the forum!

I’m afraid I don’t really follow this feature; can you elaborate some more? Screenshots or sketches are also always helpful to understand.

I think you could achieve something like this if you hid the copy code button with CSS and only made it visible again for users in a certain group. You can use CSS Classes for Current User's Groups to be able to refer to user’s groups.

I have an open community within which most of the posts are code snippets. I would like for these code snippets to have the copy and paste functionality that is typical to a code snippet or block to have this removed for anonymous users. The purpose is to incentivize sign ups via quality of life (easy copy and paste button).

I am aware of the option to have the preview plugin applied as an option to incentivize sign ups, but I do not want to block the information from being seen. I just want to introduce friction.

Thanks, I will look into this. I do think this method could be circumvented via changing code in the developer options of the browser though.

Most things you add can be worked around. You can also copy the content of the post from the raw version :woman_shrugging:

Add copyright protection to tagged topics might also be interesting for you

1 curtida

Thank you. I will look into this.

The component you recommended works.

Thanks for that. It can be applied at the theme level. which means if there is a way to have anonymous users default to theme A. and members default to theme B, the component restricts none members in the way I described.

Do you know of a way to have one subset of users with a theme, and signed up users to have another? I think it could be implemented via groups.

Such as if I could assign one group (anonymous users) to Horizon by default with the copyright tag installed and, and another to Foundation by default, without the component installed, then it would work.

TLDR: If only certain groups could select their themes and if different themes could be assigned as defaults for different groups, then the component could be used to tag 100% of posts implementing advanced protections, but it would only be implemented against one specific theme for anonymous users, and not on themes used by the member groups.

Just want to provide an update.

I found the “Gated Topics in Category” component. Its functionality works exactly how I am requesting when assigning restrictions to non-members, but instead of the paywall gate, if there could be an option to enable the copyright protections noted in Add copyright protection to tagged topics , it would allow gatekeepers to show content fully with no restrictions, show content with copyright restrictions, or show the sign up required wall as it already does.

I am not sure if this is the right place for this, but it seems like it would be added value for both the component and Discouse overall.

Neat idea – I did a little digging and found…

  1. You probably can’t assign a default theme per group:

2018: How to assign a theme to a group? – Sam said: “There is no way to do this, it sounds like an interesting request especially when extended to other parts like ‘default watched categories’ for a group and other user defaults. You would need a plugin for it now.”

  1. There’s a way you could control what themes are available for groups:

2019: Show/hide themes for specific groups? – awesomerobot came up with a CSS method to manipulate the themes available to a user based on primary group. The CSS Classes for Current User’s Groups component already mentioned could be used to expand this to any group.

  1. This is a bit of a tangent, but could be part of an alternate approach:

2022: craigconstantine developed the Umbrella-CAST component to selectively display different content in the same topic depending on the user’s group.

1 curtida