Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit Amount of a Widget Type in an Area #4655

Open
LeviticusMaximus opened this issue Jul 22, 2024 · 1 comment
Open

Limit Amount of a Widget Type in an Area #4655

LeviticusMaximus opened this issue Jul 22, 2024 · 1 comment

Comments

@LeviticusMaximus
Copy link

I know I can limit the number of widgets in an area with

main: {
  type: 'area',
  options: {
    widgets: {
      '@apostrophecms/rich-text': {},
      '@apostrophecms/image': {},
      '@apostrophecms/video': {}
    },
    max: 3
  }
}

but is there any way to limit the amount of any specific widget in that area? e.g.

main: {
  type: 'area',
  options: {
    widgets: {
      '@apostrophecms/rich-text': {},
      '@apostrophecms/image': {},
      '@apostrophecms/video': {
          max: 1 // 👈 this puppy here means only one video widget in this area
      }
    },
    max: 3
  }
}

I know I could make another area, but the order of areas in the page is still fixed; this feature would allow users to re-organise the area content avoiding this fixed-layout problem.

@boutell
Copy link
Member

boutell commented Jul 29, 2024

Currently this is not possible. I am curious what the use case would be for the feature? e.g. what is the specific scenario where you want to let people freely add a mix of widgets, but limit the number of each type separately?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants