I’m trying to read individual YAML files from user/data/selected-profiles/ in a Twig template. Each file is named like alan-lippman.yaml and contains fields like username, name, type, bio, home_state, photo_1, photo_2, date.
I’ve tried several approaches with no success:
Flex Objects — I set up a blueprint with both FileStorage and FolderStorage storage classes. The directory is found and registered, but getCollection() always returns 0 items. The files are definitely there (28 .yaml files).
Locator — grav.locator.findResource('user://data/selected-profiles', true) correctly returns the folder path, but grav.locator.findResources('user://data/selected-profiles', true, true) returns 0 files.
Questions:
-
What is the correct way to read multiple individual YAML files from a
user/datasubfolder in a Twig template in Grav 1.7.49.5? -
Is there a correct Flex Objects storage class and blueprint configuration for individual YAML files (one file per record)?
-
Is there a Twig function or Grav utility that can list and read files from a folder?
Running Grav 1.7.49.5, Flex Objects plugin v1.3.8, on Windows with Laragon.