It would be nice to have an in-built Couch way of establishing how many cloned pages may be related to another page. To put into practice, a certain room is restricted to contain less than XX items, otherwise it's messy.

It can be used in nested pages templates or simple clonable templates, where the controlling field is either of type="relation" or simply contains an ID of the "parent" page. I guess this applies to many-to-one links.

I made a validator attached to an extra field that holds a unique ID for siblings. This ID is always unique and fills gaps among the pages related to the same page. In the same template other pages may have identical sibling ID only if they belong to another group. I realized this could be also done (without PHP) via intersection of json-based arrays (to fill gaps) and dynamic default_data. But I did what I did with a validator, arguments and assoc_field parameter to achieve maximum performance.

Screenshot-2023-01-30-081041.759.png
Screenshot-2023-01-30-081041.759.png (7.65 KiB) Viewed 17095 times


Screenshot-2023-01-30-081110.034.png
Screenshot-2023-01-30-081110.034.png (5.82 KiB) Viewed 17095 times


P.S. Yes, "weight" and "order" vairables are also unique, but they increment indefinitely.