Scenario:
I have a page whose blueprint includes a structure:
specification:
type: structure
fields:
specification_name:
type: text
specification_icon:
type: files
The above is a central/global index of specifications. In child pages, items from this structure can be added via select field with query within a structure, plus a corresponding value set on the child page:
specifications:
type: structure
fields:
specification_type:
type: select
options: query
query:
fetch: page.parent.specification.toStructure
value: "{{ structureItem.specification_name }}"
specification_value:
type: text
The above is the context. The question is as follows:
If a user updates the ‘specification_name’ in the parent page, what is the best way to update all child pages that reference ‘specification_name’ and therefore will contain the old value for ‘specification_name’ saved in their .txt files?
Is there something in the Kirby API already to help with this, or do I have to write my own function and hook onto the page update/save method, and if so how do I observe and record the ‘specificaion_name’ values that have been changed since last save in order to find and replace in the child pages? Maybe compare diffs with the .lock file or something?
Thanks in advance.