admin管理员组文章数量:1322838
I'm starting to learn Gutenberg blocks.
I want to create a Gutenberg "track" block as part of a larger music "app" i'm working on.
The whole app will rely on a standard named JSPF, which is a JSON object crafted to define a playlist and its tracks.
So a basic JSPF track looks like this:
{
"title" : "Track title",
"creator" : "Artist name",
"album" : "Album name"
}
I want to build a Gutenberg "track" block that could deal with such an object.
When editing a block, I don't want it to store the HTML that will be rendered, I just want to store the JSPF track object.
For instance, the Gutenberg video block stores data like this
<!-- wp:video -->
<figure class="wp-block-video"><video controls src=".mp4"></video></figure>
<!-- /wp:video -->
I don't need to store the HTML output like that block. I just need to store the JSON object and will use a javascript (React) component when I need to display it.
How should I tacke this ?
Thanks a lot !
本文标签: block editorGutenbergin the backendI just want to store a JSON object
版权声明:本文标题:block editor - Gutenberg : in the backend, I just want to store a JSON object 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742115568a2421451.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论