I’m new to Grav and already loving it. I installed Grav+Admin on Ubuntu. I created a top level folder of type ‘Blog’ and several folders beneath it of type ‘Item’.
My question is this: I want to modify the item template to include a new field called “Customer Number”. I want the new field to appear in the Admin plugin when adding or modifying one of the ‘Item’ pages. I also want this field to appear on the frontend when viewing the page.
Where do I begin? I read the Grav docs regarding forms, but I couldn’t apply that to my problem.
SOLVED: In user/themes/antimatter/blueprints/item.yaml, I added:
customtab:
type: tab
title: My Custom Tab
fields:
customer_number:
type: text
label: Customer Number
This created a custom tab with my new field when editing an Item page in the Admin. Saving the page correctly stores the value in frontmatter of the item.md file.
Then I modified user/themes/antimatter/templates/partials/blog_item.html.twig to display the new field: