How to add a table that a client can easily edit

I’m quite a new user of Grav and slowly getting to know it. Previously I built a site using Perch CMS, but it looks like Perch is no longer in development. The site has a pricing table which needs to be updated by the client, see the site here - old website

Is there a client-friendly option which would allow someone to edit the table prices/dates without getting snarled up with markdown?

@Gibney, I guess you could use a Page blueprint with a List field.

  • When saving the page in Admin, the “table” will be inserted into the frontmatter of the page.
  • Using a plugin, you could capture the ‘Save’ action of Admin and inject the data into the Markdown of the page in any format you like.

@pamtbaau’s suggestion is best if you know your page type (template) only needs to render one specific table. Sounds like this is the case. I’ve done this for a simple pricing table.

If you want your editors to be able to insert tables ad hoc within the page content, Grav Admin’s default editor does not provide this. I have experimented recently with swapping in alternate WYSIWYG markdown editors. The one I’m playing with now supports tables but I’m not sure how good that is. I haven’t been finding great editors that are easy to customise. However if you know of one (or don’t need to customise it), it’s pretty simple to swap them in. I’d provide links, only it’s quite messy code at this point with my customisation hacks.

Thanks @pamtbaau and @hughbris for replying. So, it’s new stuff for me to learn - not a bad thing. Having a plan is half the battle and you’ve shown me how to progress. I’ll read up on this and see how I get on. I may have further questions… :slight_smile:

I’ll post back how I get on.

1 Like