Work in progress to explore how to make it possible to create dynamic, data-driven websites with Silex
This integration allows Silex to connect to a headless CMS via a GraphQL API, similar to how Webflow operates. It lets you directly pull in and arrange your CMS data within Silex, linking design elements to specific data fields. With content-based styling and real-time previews
The open source ways to get a GraphQL API, with saas and a free plan:
Load data from the specified GraphQL endpoint, use introspection to display fields and load more data on demand. Give the components a way to define "variables" which will be made available as dynamic data
[x] Use grapesjs editor object: editor.Api or editor.DataSource to get the available collections and relationships
[x] Add component.getData() to GrapesJs components to get the variables defined at the level of the component
[x] Add a component.setData(obj) to create variables which will be available in dynamic fields of the component and its children
Components traits / UI
The user need UI to be able to set dynamic data for the selected component(s)
[x] Set HTML content, HTML attributes, CSS class names, tag name, title, ...
[x] Conditional visibility
[x] Loop / repeat: iterable (the data to loop over), offset, limit, sortField, reverse
In the style manager:
[x] Each style property could (should?) accept dynamic data
In the page list:
[x] a selector to select the current item when editing the page
In the site config or settings
[x] Settings for "collection pages"
[ ] Set the url of the graphql server
UX
Each input could have a "dynamic" state which opens an editor to build "dynamic", same as n8n do:
We could also let the user create GraphQL queries with this editor but I have no idea what for?
Work in progress to explore how to make it possible to create dynamic, data-driven websites with Silex
This integration allows Silex to connect to a headless CMS via a GraphQL API, similar to how Webflow operates. It lets you directly pull in and arrange your CMS data within Silex, linking design elements to specific data fields. With content-based styling and real-time previews
The open source ways to get a GraphQL API, with saas and a free plan:
What I hope to achieve is in the same spirit as this in webflow https://university.webflow.com/lesson/collection-list
Or more powerful is flutterflow https://www.youtube.com/watch?v=0sVZ_yNw5gY
But maybe simpler for me and more flexible for the user, with expressions like this maybe https://youtu.be/1MwSoB0gnM4?si=OVlyRa4w3KdIgPVy&t=106
All of this would probably be implemented as GrapesJs plugins
I would love feedback and ideas for code or UX
Links
Data layer
Load data from the specified GraphQL endpoint, use introspection to display fields and load more data on demand. Give the components a way to define "variables" which will be made available as dynamic data
editor.Api
oreditor.DataSource
to get the available collections and relationshipscomponent.getData()
to GrapesJs components to get the variables defined at the level of the componentcomponent.setData(obj)
to create variables which will be available in dynamic fields of the component and its childrenComponents traits / UI
The user need UI to be able to set dynamic data for the selected component(s)
iterable
(the data to loop over),offset
,limit
,sortField
,reverse
In the style manager:
In the page list:
In the site config or settings
UX
Each input could have a "dynamic" state which opens an editor to build "dynamic", same as n8n do:
We could also let the user create GraphQL queries with this editor but I have no idea what for?
Excellent ux of flutterflow: https://www.youtube.com/watch?v=0sVZ_yNw5gY
The input for variables / states should be done like this
Output
There will be 2 output from the user data: