I am trying to understand how one could do the following in Grav:
-
A form outside of any page context that will simply save its data into a custom YAML file (this would be both for the admin or user side). Are there helper tools or do I just dump array to YAML and write? I would like to clarify the steps the framework recommends/allows vs just solving the problem in basic PHP and any info on this note.
-
How do I write to that form programatically - that is, without visiting the form's route with a browser, but instead e.g. adding a "Message submission" into "messages.yaml" of a user's site folder.
-
How does one do a "lookup" - e.g.
- 1) I am looking for one particular array (= "record") in any YAML file. Some equivalent of (note my human language pseudo syntax): openStream(someStream)->getItemWhere("Myfield = 15")
- 2) The same but when looking through folders, e.g. which site out of all my sites (on a multisite) has "somefield = 15" inside its relative stream "./data/somestream.yaml
-
I need custom posts but Pages is too much and too complex for them. The feature to add folders, modular pages, etc is just too complex for the use case. How do people handle that? E.g. a list of blog articles, videos, etc. managed OUTSIDE of the page tree.
-
And in that line, if the above is already possible, is there an admin plugin that allows viewing arbitrary records/posts and not pages? E.g. here are all items in your stream "/site/messages.yaml" with a simple view/edit form, and the same type of table as is used for Pages, except, of course, it's not loading pages and defult.md etc. it's loading items from the messages stream. Basically an admin view for custom forms/blueprints/"posts".
If there is none, how would one go about doing this?
Thanks!