grav-plugin-api icon indicating copy to clipboard operation
grav-plugin-api copied to clipboard

feat: ability to create modular pages

Open Regaez opened this issue 5 years ago • 1 comments

Need to figure out the best way to get/create/modify a modular page. Currently, the /pages endpoint only really supports non-modular...

Regaez avatar Aug 05 '19 22:08 Regaez

So, you can currently edit modular page content by querying for the child routes with a _ prefix, e.g. /modular-page/_module-one or /modular-page/_module-two.

However, would it be nicer to support editing modular content for parent/multiple child modules in one request? Maybe something like:

POST /api/pages/modular-page

{
  "route": "/modular-page",
  "header": {
    "title": "A modular page"
  },
  "modules": {
    "module-one": {
      "header": {},
      "content": "some content"
    }
  }
}

Regaez avatar Mar 11 '20 20:03 Regaez