Limit the choice of patterns for specific contexts

MODX Revolution 2.7.1-pl
Hello. There are several contexts, there are several user groups. Can I limit the choice of templates for context or group of users?

1 Like

Either one is possible I believe.

Is it possible, based on your needs, to define the contexts available to each user group? And then you could define the templates to the contexts.

I think the above perhaps makes the most sense, but pls do be careful, setting up multiple contexts can be tricky.

Also feel free to talk about your needs more, every solution is unique and its impossible to know the best way without more info.

Also let’s get more feedback from more experienced devs on this.

1 Like

I don’t think there’s any easy way to do it by context, but you can certainly do it by User Group.

You need to put the Templates into categories and then use an Element Category ACL entry for each connection between a user group and the category of the Templates they can access. The Templates are protected (hidden) when their category is connected to a user group (with an Element Category ACL entry) and the current user is not a member of that user group.

See this.

1 Like

I have several sites that are similar functionally. They are made in different contexts. Each context is accessible to a specific group of users.

When a group of users edited their context, it would only see templates that relate to that context.

I think you either need to link the context to certain templates or a group of users to choose only available templates. But I don’t know how to make :frowning:

In extreme cases, I think simply by disabling the choice of templates for all user groups. Specify the default templates, the default templates for the parent, etc.