-
Notifications
You must be signed in to change notification settings - Fork 24
Description
This came up on our call this morning. We thought it would be valuable to only allow a builder part to be used within a certain area. Some parts may not make sense in another area or could break another area unless front-end devs put in a lot of extra work to ensure design compatibility. It would be best to not give an option to place parts in areas if we know they will break the area or should not go in that area for whatever reason.
One option I have for declaring this, is to require a file header for builder template parts like how WordPress themes require them for page templates. You can use the following function to easily parse this: https://developer.wordpress.org/reference/functions/get_file_data/
In there you could declare a builder area which that part can only work for. This may also be a better way to display the names of template parts rather than the current method of taking the file name. It would allow better descriptions that don't fit in the few words you probably want to use for a file name.