I’m trying to manage language variables in the panel using a structure field like it’s suggested here:
function getVariables($lang = null) {
/* here you can fetch your variables from anywhere:
** a spreadsheet, a .csv file, or
** from a structure field that you can edit in the Panel
*/
$translations = [];
return $translations;
}
It’s probably a stupid question, but how can I actually access the structure field within this function and build the translations array?
The structure field is located in site.yml, but trying to access it using kirby()->site() results in fatal error: allowed memory size exhausted.
Ah, yes, maybe it’s not possible like this after all, because the function is called in the translation file, so a problem similar to calling kirby and site in the config.