0.9.43
What's Changed
[feature] API HTML renderer
Addresses: #267
guide for querying: #995 need better docs
Demo
Screen.Recording.2022-08-19.at.10.39.52.PM.mov
Demo Sortable
Screen.Recording.2022-09-05.at.9.15.45.AM.mov
HOW TO USE
Api Resource Index
- create snippet with identifier same as api_namespace slug
- Variables available on snippet: @api_resources & @api_namespace
- Render the snippet on any page with this helper: {{cms:helper render_api_namespace_resource_index 'identifier'}}
- Is filterable using query params, eg: http://lvh.me:5250/?properties={"synced":"false"}
Api Resource show
- create snippet with identifier as api_namespace slug with '-show' at the end, eg: people-show
- Variables available on snippet: @api_resource & @api_namespace
- Render the snippet on any page with this helper: {{cms:helper render_api_namespace_resource 'identifier'}}
- id query params is mandetory, will raise 404 otherwise. eg: http://lvh.me:5250/?id=123
{{ cms:helper render_api_namespace_resource 'slug', scope: { properties: { property: value } } }}
for sorting you can do something like:
{{ cms:helper render_api_namespace_resource_index 'cars', scope: { properties: { published: 'true' }, order: { created_at: 'DESC' } } }}
to only show resources created by the logged in user:
{{ cms:helper render_api_namespace_resource_index 'time_tracker', scope: { current_user: true }, order: { created_at: 'DESC' } }}
Full Changelog: 0.9.42...0.9.43