User-defined key/value pairs in Admin


#1

Hi, I’m trying to make a simple way for my customer to make a spec sheet that is converted to an HTML5 definition list for a product page I made. The way I’m planning to achieve this is by adding a field in the admin panel that lets them create a key/value pair list that I can pull from in my product page template to generate the HTML. Is there a better approach to doing this than creating a plugin function?


#2

If I understood correctly, you are thinking of creating a plugin for key/value pair list.

What you need is https://learn.getgrav.org/forms/blueprints/fields-available#the-array-field.


#3

Yes, it is this kind of feature I’m looking for. That should allow me to add the feature I’m looking for. Thank you very much!

P.s. Sorry if my question was confusing. I’m new to Grav and am still learning how it all works.


#4

It wasn’t confusing, I was just making sure I didn’t miss something.

Glad I could help.