phptwigyamlgrav

Grav/twig: Want to make custom yaml objects and retrieve their data in custom page sections


On my Grav site I want to create a flatfile database of yaml objects that doesn't have anything to do with the site proper

Basically it will be a webpage that will draw up the collection of of objects, and if you want more information about that object, click on it and get more info. All of this just accessing the associated yaml file. ( This is a small website and is in no way sensitive data. Just a way to retrieve basic information )

I'd like it to work how Grav as a whole does, where I could go like

{{puppies.name}} and spit out the asssociated datas. Or do a for-each and chuck out all the objects in the folder with their relevant datas

I wanted to do this in just a regular naked PHP site but I have coworkers who need to update text blocks so I decided to try a CMS.

If this is a dumb question, I'd like to know if there's a CMS where I can just denote a few text blocks/pages for admin edit and do the rest in PHP my way. Twig is really difficult to do anything custom with. But I like the idea of flatfile databases.


Solution

  • I'm switching to wordpress. Twig is a nightmare to customize beyond being a simple templating engine, and there's very little help online to look at. It's more confusing to me than just straight up developing code. It takes so much to override anything, like you have to create whole plugins just to do something remotely custom using raw php. Too many brick walls, I gave up.

    I wanted to avoid wordpress initially but it's actually so much easier to use shortcodes and write super duper custom sections that fetch custom sql tables and dump info. I wanted to avoid a really formal cookie cutter way of doing this but this seems to be best.