GrapesJS moving Mustache tokens
@MiseryMachine have you tried wrapping your table internal's inside a `tbody` in your block definition? or at least moving your mustache tokens inside a tag?
Read full answer below βQuestion
Hello, I am working with GrapesJS to allow users to create report templates. I've run into a problem with a block that creates a table, but the table rows are determined by Mustache tokens. However, when rendered, the tokens are moved outside of the table element. I believe the table or table row style is not allowing the existence of these tokens within the table element structure. My block: The product-list-type: When I drop the element onto the canvas, the {{#bomGroupProducts}} and {{/bomGroupProducts}} tokens are moved above the entire table. I need those tokens around the <tr> elements,...
Answers (3)
@MiseryMachine have you tried wrapping your table internal's inside a tbody in your block definition? or at least moving your mustache tokens inside a tag?
Thanks for your suggestion. I have tried that with the same result, unfortunately. block script: Output: Maybe it's because GrapesJS is, by default, enforcing HTML structure. I'm still trying to work this out though.
No, you can't do that because in that case, you have an invalid HTML, so the HTML parser moves it out. You have to create a valid HTML content to make the browser render it correctly:
Related Questions and Answers
Continue research with similar issue discussions.
Issue #481
Question: Dragging blocks into a Text block?
This is not a bug but an implementation question. If this is not the right place to ask these questions, please let me know. We're working...
Issue #2380
[QUESTION] Support multiple languages for the page content
What we need is to create a page once but translate the text content in multiple languages. Imagine a very simple sample of a single text b...
Issue #1892
[Question] Flexbox column is not working correctly.
Hi @artf , We are using flexbox block. The problem is, when we are trying to resize the middle column it affects all other columns, like au...
Issue #2601
[QUESTION/BUG?] Dragging second block don't haveCSS
Hi! I've manage to create different blocks with their own HTML and CSS using BlockManager. But once I drag the same block, the CSS is not w...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βBrowse Plugin Categories
Jump directly to plugin category pages on the marketplace.