Ability to Create Private Templates

Since the launch of the new Discourse Templates plugin, I’ve really been enjoying the new functionality of having reply templates stored in topics within a dedicated template category. This makes it easy to view and edit templates, while allowing the ability to filter, tag, edit, and sort existing templates as needed.

However, currently there can only be template category selected at a time, so all templates for a site are shared by all users with access to the set template category.

Additionally, if a user wanted to create a template that only they themselves could access, there’s currently no way to do this without modifying access to all templates within the template category.

Feature Request

Based on these observations, here are a couple features that I feel many different types of Discourse users could benefit from:

  1. The ability to create a personal private template that only the user who created the template could access and view.
  2. The ability to create private templates that two or more users on the site could access, but would still be hidden from anyone else.

Example Use Cases

A few ways this could be used in different situations.

  • A user wants to create personal templates for themselves, but doesn’t want to clutter up the main templates category with irrelevant templates for the entire site.
    • Ex: Alex’s company uses Discourse as a support platform, and they want to store answers to every possible customer question as a template. Even if the templates never get uses, Alex can reference back on their personal templates for future related customer questions, or knowledge about something they might not have seen in a while - even if the templates never get used.
    • Ex: Alex uses Discourse as community forum for the products and services they are selling on their main (non-Discourse) website. Alex creates a template for a topic that only they post to their Discourse site every Friday to help build engagement.
  • Shared templates for an entire team but not the entire company.
    • Ex: Alex works as a software developer, and their team frequently runs though multiple different sets of tasks internally. The software development team has a template with a checklist or other actionable items for each set of tasks that needs to be completed by each member on the team.
    • Ex: Alex manages a team who uses Discourse as a support platform. Alex creates templates that only the support team can access to help the team respond to customers faster.
  • Two or more members of a team would like access to the same templates, but they don’t need these shared with the entire team.
    • Ex: Alex works in support and John works in software development, their company uses Discourse to communicate with customers. John just fixed a bug, so he decides to create a template explaining the changes he made to the company’s software to fix the bug - he then shares this template with Alex so they can inform customers about the updates. Once all customers have been notified the template could be deleted.

I’m sure there’s many more use cases not mentioned here.

The Need for Balance

With all this in mind, and regardless of what features exist for making templates public or private, users of a site still need to decide - “Who should a template be shared with?”

There’s a balance between “Everyone on the site will use this template everyday”, and “Someone used this template once for one specific task and now it’s never used again”. In this first situation, yes of course we’d want this template to be shared with everyone, but in the later case, if the template was shared, it would simply clutter up the list of templates, and the list of all templates could quickly become overwhelming, outdated, or extraneous if there were no standards as to what is an “acceptable” template for the entire site.

What About Tags

With Discourse Templates, we can now tag each template to help with sorting and finding templates when the time comes to use them, so why should we even need templates that are private to an individual or team? Why couldn’t a support team just tag all their templates with a #support tag and be done with all this? Why couldn’t Alex just tag all their personal templates with an #alex-templates tag and move on?

Short Answer: There’s no reason why this wouldn’t work. Users can simple tag templates and then search for them when they’re trying to pull them up.

Long Answer (which is really just more questions): When people use templates do they scroll through all of them, or just search for what they need? If you’re just searching for templates, the number of templates you’re searching through probably doesn’t matter as much - you just search and then you’re done once you find what you’re looking for. However, if you’re scrolling through all the possible templates you could use, this could be a lengthy task depending on how many templates your site has.

What if your site is huge? If your site had 1000 templates, but you only ever use 10 of those, why should you need to see all the extra templates, wouldn’t those just be extra clutter for you? Okay, a little extreme, but still, there becomes a threshold where there’s just too many templates for a particular set of people, or entire site to have access to.

Also, what if you don’t know what to search? What if you just started moderating a particular Discourse site and you don’t know what all the templates are named, and there’s 100 of them? What if you’re searching for an “site introduction” template, but someone called the template you’re looking for “welcome” (or a similar situation) and your search doesn’t bring up anything?

There’s lots of questions that need to be considered here, and there isn’t necessarily a right answer.

It looks like other users on here may have thoughts about this as well. While this was about the now outdated Canned Replies plugin, the ideas expressed are still applicable here:

Possible Ways to Implement This

When we think about the actual mechanics here, it has been mentioned that @saquetim may know more about how to best implement this.

For personal templates, perhaps a PM to self + special tag could do the trick?

If you wanted a couple people to have access to a template, maybe you could PM yourself, and the other person with a special tag?

Maybe we could have the ability to select multiple discourse templates categories?

What are everyone’s thoughts about this? :thinking:

  • Would something like this actually be useful?
  • Why would we want the ability to create private templates?
  • How do we want this to be used?
8 Likes

I use templates extensively! And I use Discourse Templates the same way I use Discourse Chat: alone, one-on-one, and in any possible group configuration! :v: :sunglasses:

In each of those examples it sounds like how PMs work, which I think is great: the ability to add and remove users and groups…

Hmmm… maybe having options similar to how Discourse Docs sets categories and tags.

Screenshot 2022-07-11 at 16-34-50 Admin - Sandbox Discourse Kit

However, in addition to showing all template topics available based on category permissions in the template chooser, it also loads PM templates. So you would tag all your PM templates as needed, and would share them as a normal PM (users and groups).

:thinking:

3 Likes

Oh my this would be so useful!!

2 Likes

@AlexDev,

I really liked the idea of private templates and the mechanics you proposed (PM to yourself + tag) and I think it would be a great functionality to add in the plugin. I’m not that sure however about two+users be able to share this templates using PMs.

Let me explain why:

Currently, you can only select a parent category to store templates but you can have sub-categories with different permissions to address multiple groups seeing different sets of templates. This use case should be covered.

In addition to that, I plan to add to capability to have multiple parent categories to allow better template organization and easier security definition.

The problem arises when you add PMs to groups (formal or ad-hoc) in the mix because the permission system becomes messy. Tags do not have permissions like categories. It would be hard to check if a user can use templates or not, or even limit his ability to do so.

Some things that come to my mind now that have to be addressed:

  • Which users should be allowed to use private templates? I don’t think they should be allowed by default to everyone and currently the permission to use the plugin is defined by the category in which the templates are stored. This permission model wouldn’t work for private templates and we would probably need a new setting so admins can control that.

  • The tag used to mark private messages as templates should be defined globally in the plugin configuration or allow each user to define in the user settings which tag should be considered a template? How would that work for messages shared by more than one person?

  • One thing that I don’t like that much about it, is that it can make harder to find where to go when you need to edit/discuss a template. The users will need to know if it is a PM or a topic. It is not a deal breaker but it can become cumbersome.

TL;DR: I really liked personal templates (PMs to yourself), I think that PMs to multiple people used as templates may cause some issues and this would have to be thought with care. Personally, I would go with really private templates (only the user that created can see) and leave group templates (2+ people) to the category system.

5 Likes

I think multiple parent categories along with the proposed private templates using the PM to yourself + tag would cover almost all of the use cases with templates.

Even with some of the examples I mentioned, it was hard to come up with a case where two+ users, and not a group, would need to share the same templates.

If two people wanted the same template, they could always just PM each other with the template and then turn that message into a template by copy + pasting the PM back to themselves, which would be a small extra step, but I can’t imagine this coming up very often.

I feel like Trust Levels could be a good way to restrict the use of private templates to only those who might need to use them. One of the issues I could see happening with private templates (and templates in general), is that if a user had access to them they could create a lot of “spam” on the site by posting the same thing over and over again, to the point that their account could need to be silenced or otherwise restricted if it got really bad. Templates in general also seem like more of an admin / moderator / super user type feature, rather than something everyone should have access to, and only allowing higher trust level users to use private templates would address this. ’

I’m imaging a setting in the Templates Plugin to allow “Trust Level X” or higher users to use private templates. Something like this, but for “Private Template Min Trust Level”.

My other thought here would be a checkbox setting somewhere in the group settings page for each trust level group to “allow private templates”, but having a single place to set this up would probably be preferred, instead of having to edit multiple group settings.

Defining the tag globally would be easier to setup from a site admin standpoint, and then somehow informing users that “this is the tag to use for private templates” to make this apparent. I feel like this might be able to work if a PM was shared between more than one user since the private template tag would be globally defined, and would still work in situations where the PM template is only shared with the user who created it. Although, I’m not sure what kind of implications this would have on checking if a user can use templates or not since everyone would be using the same private template tag with this design.

This is a great point, and something I hadn’t considered. Thinking about our workflow currently for tracking down where you need to go to edit a template - If I’m making a post with a template in it and I want to view the topic with the actual template, the easiest way I can think of would be to search the template name with the site search, and then jump to that topic. However, as far as I’m aware, you can’t search PMs with the site search, so this wouldn’t work with private templates.

Perhaps a button within the template selection area when you’re making a post could be helpful here? Something like:

It would definitely be nice for a user to have all templates available in one place, but I’m not sure what the best answer here is.

I’m curious to hear about what other thoughts there are about this.

1 Like

This is a really interesting point. :+1:

I’m thinking solely about cluttering up the interface for staff users. I’m not imagining a use-case where the templates category allows the general membership to add/edit them.

Hmmm, I wonder if I created a tag on my site, #preferred-templates-maiki, and then I could just choose it and have all the templates I use ready for me. Then I could tag a bunch of topics, not only my own… :thinking:

1 Like

I wouldn’t add a button there. The canned-replies plugin was like that. IMO, the interface gets a little bit cluttered for something you woudn’t use that often.

Maybe it would be better to create a route similar to /top or /latest that would list all available templates in on place. We would have maybe /templates and there you would just have to click on the topic to open it.

I thought about this when developing the plugin.

I know it could be convenient, but in my opinion it causes more problems than it would solve.

Topics tagged that way can’t leverage the category permission system to define if the user can use templates or not and at least for me templates should be in a place (category or tag in the case of the proposed personal templates) where anyone who deals with them knows that it is dealing with a template.

Imagine you tag a post from a third party as template and it gets edited to something you don’t expect. You will be unaware the template was changed and the person who edited it will be unaware it edited a template.

I don’t know, in this case I prefer a well defined flow.

1 Like

That makes sense! :+1:

I was referring to tagging topics inside the template category. Here’s a screenshot from our family forums where I tagged all mine #maiki-templates.

My use-case does not take into account everyone creating templates. But with tag groups I believe we have decent control for teams to use them.

In my family’s case, Clover and I will both have lists of chores we have to checkoff. It makes sense to have them all tagged as #chores, while the templates I’m responsible for are tagged #maiki-template, and Clover’s are tagged #compulsory-familial-servitude; then we are able to easy filter the templates as needed, from the “Insert template” selector.

So… my use-case is covered. :slight_smile: :+1:

My private templates are public! :person_shrugging:

1 Like

We have private templates now!

They work pretty much like what we’ve discussed. Send a PM to yourself + tag it with a special tag configured in settings and the message will show up in the templates list.

Technically messages sent to other users can be used as templates as well but they will only be displayed as templates for the author of the message.

5 Likes

This is great to hear! I’m excited to try this out soon.

2 Likes