As the title suggests, we’re trying to better understand the behaviour of the PLACE_TYPE variable. We’re also wondering whether there’s a PERSON_TYPE counterpart that we may not be aware of.
After reviewing the generic form doc, we noticed some differences between the documented approach and our current setup.
In our project:
- We have a generic
PLACE_TYPE-create/editform and aplace-types.jsonfile in thecontactfolder. These haven’t been modified since the initial repo setup. - We also maintain type- and level- specific contact forms, which we update regularly.
What’s interesting is that although we use type/level-specific create/edit forms (rather than these generic forms), we’re still able to access and use the PLACE_TYPE variable within those forms. And seemingly have for a long while. It resolves correctly, even for some newer place types that are NOT defined in the place-types.json file (maybe worth to note that it’s just the normal types with a “ff_” prefix (feature flagged)).
What’s nice is that it makes it easier to share pieces of functionality across forms with fewer edits than expected. Important to note, parts are reusable - not the full form.
Even more interestingly, person forms appear to exhibit somewhat similar behaviour. This one threw us a bit. While using PLACE_TYPE directly (e.g., as the group name of the data persistence block, as we do for places) does not seem to work for people, we are still able to reference values FROM the persistence block successfully.
Resolves:
Above fields in xlsx:
Persistence block:
We’re trying to determine:
- Is this expected behaviour? Is
PLACE_TYPEresolved more dynamically than the docs imply? - Or are we relying on behaviour that could break in future updates?
