GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.38k stars 4.06k forks source link

[Question] view vs code #1897

Closed sandromattei closed 5 years ago

sandromattei commented 5 years ago

Hello...and sorry for my english! First of all, congratulations for this fantastic framework. I'm trying to use GrapeJS to create my own wordpress editor and I have a doubt. If in my code I use a wordpress "shortcode", how can I preview this shortcode in grapeJS but leaving the html code unchanged? thanks a lot

artf commented 5 years ago

I don't know what kind of API WordPress allows you to use for shortcodes but if it's possible I'd render them and put inside the editor as blocks

sandromattei commented 5 years ago

sorry, maybe I explained myself wrongly. I would like to insert a shortcode in the code (eg [my shortcode param1 = value1 param2 = value2 /] and render an html output instead (eg <div class = "param1" id = "param2"> </div>)

artf commented 5 years ago

Well if you need to do that on runtime you should create a custom component which on render makes an async call to Wordpress to ask to render that shortcode (again, I know nothing about WP API so I'm not sure if it's possible)

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.