Issue #1897Opened March 16, 2019by sandromattei0 reactions

[Question] view vs code

Question

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

Answers (3)

artfMarch 23, 20190 reactions

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

sandromatteiMarch 24, 20190 reactions

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>)

artfMarch 24, 20190 reactions

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)

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.