Closed geekbrit closed 4 years ago
I wrote some php code to take data from BrickyEditor & a templates html file, and munge them together into static html that can be loaded without having the editor in the target page: https://gist.github.com/geekbrit/f871e56f7c3befe319ec70deec9d5f95 It all got a bit recursive, but this does populate containers correctly using the data from BrickyEditor.
Hey @geekbrit ! Do you mind showing example of using your PHP script? It is not registering in this old head.
Thanks.
Hi Susan, sure... But it maybe a couple of weeks, we're driving across the whole US and back!
My example isn't complete - eventually it will save the HTML to a file, which will be used to serve the page. This function runs only when changes are made with the editor.
On Mon, Jun 4, 2018, 2:56 PM Susan notifications@github.com wrote:
Hey @geekbrit https://github.com/geekbrit ! Do you mind showing example of using your PHP script? It is not registering in this old head.
Thanks.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yakovlevga/brickyeditor/issues/32#issuecomment-394478885, or mute the thread https://github.com/notifications/unsubscribe-auth/ABL9SZkyOLsuFDyfEzX8Yodtn4WnnoFpks5t5ZEBgaJpZM4UWlBN .
No problem @geekbrit I like to be smarter than the kids at least once a month so waiting is not an issue.
Be safe and enjoy your adventure.
Hmm... my gist worked on the simple test case I was using, but when you add more code to the containers it starts to fall apart. There are also some inconsistencies in the json data where sometimes you have to replace the contents of a div with the supplied html, and sometimes you have to replace the div with the supplied html. I'm rethinking using this editor because there isn't an easy way to use the generated pages without having the editor in the page.
On the plus side, I found that there is a small bug in the code that when fixed reveals a very nice extra tools widget - line 1584 "this.buttons = editor.options.htmlToolsButtons;" is stopping the tools appearing, I think the conditional around this line should go around the buttons definition just above.
Its a great editor on the concept of it but when I create blocks and put data into it and save. It does save but when it fetches on the editor the blocks don't render. I might be missing something or if anyone found a solution to it. e.g. below screenshot has data in the blocks, but the container will come with "Click the container to add data". Please help!
was fixed with v0.8.4
I'm very impressed with this project, I've been trying to find the right balance between user-edits & avoiding page breakage for some time, and this is perfect!
I'm having problems loading a page that has containers in it. In the saved JSON I can see the data that is supposed to go into the containers, but all I see on the page are placeholders. My test page uses this block information:
I don't know if the problem is related to the escaped quotes (") in the encoded html fields, but when I try to trace through the editor code, it always has an empty blocks parameter when deciding whether to put a placeholder in the container, and two lines before the call to this.togglePlaceholderIfNeed() this.blocks is set to [ ].
In case it helps to see where I've gone wrong, here is the template: