uwizy / strapi-plugin-webpage-builder

Add GrapesJS builder to your own strapi application
MIT License
63 stars 28 forks source link

user's grapesjs components #1

Open NilsTessier opened 4 years ago

NilsTessier commented 4 years ago

i wan't to add user made grapejs components integration. i could fork and create pull request to contribute but you may already have an idea of how you wan't it to be done ( with a custom strapi content-type containing html/js/css fields or through user created files in ./extensions/strapi-plugin-webpage-builder/ ? or whatever... )

what are your thought about this feature ?

also, maybe we can discuss in french on another channel

digitalsanity commented 4 years ago

Maybe store in a json file tied to a custom content-type that renders out the page on afterSave hook, then you could add additional strapi fields as template variables to insert/replace also -- giving you sort of a two-layer/mode approach.

The person entering content into template fields on the custom content-type does not necessarily need or want to see the html/js/css layout data or grapejs tool.

You could also add a reference field to the content-type to reference an optional 'parent' -- which would let a user 'fork' and overlay their own values for the template data fields and override the grapejs data while using the parent as a starting point.

digitalsanity commented 4 years ago

Or maybe I'm overthinking this and it should be two content-types .. one for layout (grapejs) and one for content overlay -- e.g. replace {{title}} in grapejs HTML with field: title of the overlay content type -- then the overlay would become the final page that is rendered with {{template-vars}} replaced and the layout would render out the as-is grapejs HTML. You could still have a parent reference to allow 'forking' (quickly creating a new layout or page using another as a starting point)

8byr0 commented 4 years ago

@NilsTessier My bad, I didn't get any notification about your comment...

I developed this plugin to have image integration within grapes for a project and did not really think about future integrations but I'm definitely open to such new feature !

I think there are two possible implementations:

It's been a while since you commented, did you start anything? I'm open to french discussion but I think it's better to stay here in english so that people can get involved in discussion!

@digitalsanity I agree with your approach, it would be cool to get templated blocks replaced with actual content