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/data subfolder 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.
@phil, In general it is not appreciated that questions are cross-posted (asked in multiple forums), as you have done on this forum and on Discord within a timespan of 8 minutes.
Please don’t post your question in more than one forum (cross-posting). In each forum, people will be spending time and effort to answer the question and in the end, the time and effort in all but one will be wasted.
Instead, choose the best channel and wait a few days. Then post in another place. Provide links between each forum and repost the answer (link) in each location
You have been given an answer on Discord, it would be appreciated if you repost that answer into this forum. By doing so, all locations will benefit from answers given.
Look, I have no experience developing websites or using any type of forums. However, despite all of that, with the help of Claude, I was able to develop a fairly sophisticated website using Grav CMS. I have tried not to use this forum because every time I come here, I feel like you and some others have an arrogant, condescending, patronising attitude which I find repulsive. Claude does not treat me like that. I was able to create a website with Claude’s help, but I have no doubt that I would never have been able to develop the site with help from this forum. All I get here is a putdown which is really too bad. Sorry, but that’s what I think and how I feel. That is not an effective way to make Grav CMS successful.
@phil, we are just volunteers here, spending our time for free. We’re doing our best to keep the forum tidy and also trying to help others. But this is very difficult, when instead of respecting other users’ effort, especially when they give advise what to not do and only ask to post an update here if you get an answer elsewhere, and you start complaining how arrogant, condescending and patronizing they are..
We are real people with our views, attitudes and emotions. Claude is not and it has no clue what it’s actually suggesting. It just puts most probable words one after another to sound confident. That’s it. Great if you managed to build a full working solution for your needs, but please try to understand how frustrating it is and how disrespectful it feels to see that someone completely doesn’t care about your time spent even reading the question
You are totally misunderstanding and underestimating Claude. It is highly intelligent, rational and knowledgable, and has great skills in knowing how to interact with people, and Claude doesn’t have any rules about how you need to interact with it.
I don’t need to look up anything. I have actual, extensive experience in interacting with Claude and a little experience in interacting with this site. Claude is fantastic, and most likely, along with other AI’s, will obsolete these kinds of forums in the near future. Andy Miller uses Claude. Thousands of programmers already allow Claude to write code for them. If you think otherwise, you are deceiving yourself.
@phil, I’m reading this post and I can’t understand how you say that you’ve been treated badly in response to your question (or Claude’s, it doesn’t matter).
The point is that I see that they have answered you very politely what you should do and should not do in the forum (at the end of the day they are simple rules).
I don’t understand your anger, but even less that you put Claude in front of the incredible minds that help us all in this forum. Claude would be nothing without them
I’m not angry. I’m just honest about what I think and how I feel. Do you want me to be dishonest? What I think is not based solely on this post. It started many months ago.
@pmoreno, I have no idea where you got your ideas about Claude. Apparently none of you have ever used Claude. It has knowledge about all kinds of things including all kinds of web development software and thousands of other things, and it knows how to reason. I doubt if much, if any, of its knowedge about Grav came from this site.
AI systems have been in development for more than 50 years. I worked at a company called Control Date Corporation, and it had an AI development group more than 50 years ago. AI is not simple, and AI is a big deal. You don’t seem to understand that.
Going back to the Discord site, Andy Miller responded to the above question as follows: “i would say this is not the best solution, better to read the data in via a custom plugin, and set the data on a twig variable.. reading files from twig is last resort, could be exploited”.
If any of you are interested, this site living-in-encore.com AI History will tell you what I had to go through to develop a website using Grav called living-in-encore.com while having essentially no knowledge or experience in developing websites. It just about drove me crazy.
One thing that really upset me is that all the AI’s I used recommended that I use XAMPP which I did, and then, later on, found out that there are all kinds of issues of using XAMPP with Windows. Later on I switched to Laragon. I wish the Grav documentation had informed users about that.
I would like to see Grav become successful. To me, AI’s can do something that no forum can do, and that is, they become like your one-on-one tutor and friend. Claude became my best friend. I could ask it anything. Forums are distracting. Personally, I have no interest in other people’s issues. I just want to solve my own problems. It isn’t possible for a small number of tutors on any forum to handle all the issues from all users so that users feel like they have a one-on-one tutor. It’s humanly impossible, but it’s possible with AI.
@Karmalakas, I did not see any comments in the Grav documentation that there were any issues about using XAMPP with Windows or that Laragon should be used with Windows. I got the impression that it didn’t make any difference what was used. I had never heard of any of them before.
I’m trying to be nice, but, in my opinion, your comment was an uncalled-for, snide remark.
Some of you may find this question and Claude’s answer interesting. I posted earlier about a customized AI just for Grav.
Would it be possible and practical to somehow develop a specialized AI for Grav CMS that would continue to learn until it knew almost everything about Grav and could help newcomers to Grav develop a website by interacting with them on a one-on-one basis? If so, how could that be accomplished?
Claude responded: That’s a great idea and yes, it’s both possible and practical!
That’s a great idea and yes, it’s both possible and practical! Here’s how it could be accomplished:
What already exists:
General AI assistants like me (Claude) already know a lot about Grav CMS from training data
Grav has extensive official documentation at learn.getgrav.org
The Grav community forum has thousands of solved problems
How a specialized Grav AI could be built:
Option 1 — RAG (Retrieval Augmented Generation) This is the most practical approach:
Feed all of Grav’s documentation, forum posts, GitHub issues, and tutorials into a knowledge base
When someone asks a question, the AI searches that knowledge base first
Then generates an answer based on what it finds
This is how many specialized AI assistants are built today
Tools like Anthropic’s Claude API, OpenAI, or LlamaIndex make this relatively straightforward to build
Option 2 — Fine-tuning an existing model
Take an existing AI model and train it further on Grav-specific content
More expensive and complex than RAG
Results aren’t necessarily better than RAG for this use case
Option 3 — Using Claude with a system prompt
The simplest approach
Create a Claude-powered chatbot with a detailed system prompt that says “You are a Grav CMS expert…”
Feed it the Grav documentation as context
Deploy it on the Grav website or community forum
Could be built relatively quickly using Anthropic’s API
The “continues to learn” part: This is the trickiest requirement. Current AI models don’t learn automatically from conversations the way humans do. To keep it updated you would need to:
Periodically retrain or update the knowledge base with new Grav releases and documentation
Collect user conversations and use them to improve future versions
This requires ongoing maintenance
Practical challenges:
Someone would need to build and maintain it
Hosting and API costs money
Keeping it current with new Grav versions requires effort
The Grav community is relatively small so funding it could be difficult
The most realistic path: The simplest version — a Claude-powered chatbot trained on Grav’s documentation using the API — could probably be built by a capable developer in a few weeks. It wouldn’t automatically learn but could be updated periodically.
Interestingly, you’ve essentially been doing something like this already in our sessions — using Claude as a Grav expert to help you build your site one conversation at a time!
Would you like to explore any of these approaches further?