The PR adds support to the API for "Dynamic Blocks", where a dynamic block is one which:
generates its block field values dynamically via code, external api requests, database calls etc, on each request
AND / OR generates dynamic pages to match URLs UNDER those of the page on which it is embedded.
e.g. a "Profiles" block at /site/profiles which displays a list of staff from a database then allows viewing individual staff profiles on "virtual" pages at /site/profiles/.
Dynamic blocks must:
set an attribute "dynamic" to 1 within their definition.json.
implement a dynamic block class named after their definition name and version which extends App\Models\Definitions\Block
implement one or both of the route() or filterData() methods as required.
Dynamic page URLs are only matched via the /api/v1/routes/resolve API call (used by renderers), not via other API requests which operate on page ids.
Dynamic blocks are currently only used within the ResolvesRoutes trait and the PageTransformer, but could easily be adapted to, for example, provide extra validation logic on saving pages, etc.
See the dynamic-blocks.md file in the root of the repo for more information.
The PR adds support to the API for "Dynamic Blocks", where a dynamic block is one which:
e.g. a "Profiles" block at /site/profiles which displays a list of staff from a database then allows viewing individual staff profiles on "virtual" pages at /site/profiles/.
Dynamic blocks must:
Dynamic page URLs are only matched via the /api/v1/routes/resolve API call (used by renderers), not via other API requests which operate on page ids.
Dynamic blocks are currently only used within the ResolvesRoutes trait and the PageTransformer, but could easily be adapted to, for example, provide extra validation logic on saving pages, etc.
See the dynamic-blocks.md file in the root of the repo for more information.