Help newbie Grav plugin development (from WP)

Hi everyone,

We are transitioning from WordPress to Grav and are currently exploring plugin development. Coming from WP, we notice that there is significantly less documentation and community content available for Grav, making it harder to find clear examples. Even with AI assistance, it’s still challenging to figure things out.

Our goal is to create a custom content type similar to WordPress “Custom Post Types.” Specifically, we want to store relationships in a table format with fields like name, surname, email, website, and phone number. We need full CRUD functionality: adding, editing, and deleting entries within the Grav Admin interface.

So far, we have:

  • Created a basic plugin that adds an admin page.
  • Defined a YAML blueprint for a simple form.
  • Attempted to store data, but it’s unclear how to properly manage structured entries in a way that works well with Grav’s flat-file system.

Our main struggles:

  1. How to correctly structure and store this data (should we use YAML, JSON, or something else?).
  2. How to dynamically add, edit, and delete rows efficiently within the admin panel.
  3. How to make it behave similarly to a WordPress CPT while staying true to Grav’s philosophy.

Additionally, are there any recommended resources, documentation, or even a boilerplate example for this type of plugin? Something that outlines best practices for creating structured content with full CRUD operations in Grav?

Is there anyone who could guide us in the right direction? Maybe share some examples or best practices? Any help would be greatly appreciated!

Thanks in advance!

1 Like

Are you trying to add a DB support? I believe there are plugins that do this already :thinking:

Hi,
I really like Grav because it’s incredibly fast, so I don’t want to use a database. Instead, I’m focused on figuring out how to build my own plugin with full create, read, update, and delete (CRUD) functionality.

So far, I’ve managed to get writing and reading to work, but I’m still struggling with the delete functionality. I also have a few other minor issues, but I believe I’ll be able to figure them out with some more testing and debugging.

Right now, I’m actively searching for PDFs, documentation, or demo plugins that showcase best practices for handling structured data in a custom plugin. Any pointers would be much appreciated!

I can share my zip for anyone who likes to help. I believe with some more plugins it can beat WP.

Well… Not the best documentation, but still quite informative:

I’m still not sure I understand what your goal is. Grav already has all the CRUD functionality. Maybe you’re looking for something like Flex Objects?

1 Like

flex objects? Im new… I just need to figure out how this works in place of wordpress.

Thank you… i’ll check it out.