You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use a library like Alpine.js to build basic interactions in my pattern and parts files. It requires adding directives directly into the html. It also requires adding data into data-attributes. Both of these actions causes the edit view to return a "his block contains unexpected or invalid content." error. It works without an issue in browser. It only breaks in the editor.
What is your proposed solution?
If would be great if there way a way to indicate that the editor should ignore a piece of code allowing it to pass through to the browser without breaking the editor. This should also work for allowing html to be sent through without requiring the comments that allow it to be editable. For example I may have a template part with some decorative element that I don't want a user to edit. This would allow it to show up with appearing in the list view.
The text was updated successfully, but these errors were encountered:
CGTS
changed the title
Allow Javascript and non-editable HTML in Template Parts and Patterns
Allow Javascript and non-editable HTML in Template Parts
Jan 31, 2023
Is it not possible to use a locked HTML block for adding this HTML?
If not I would suggest creating a custom server rendered block - since you don't want users to edit it.
It may be possible to use the html block for the decorative html (Is it possible to have the block default to the preview of the html?). However, I don't believe it would be possible to use it for the inline directives. I would be adding x-data="menuOpen" to the container div and would need to add the nav block and buttons into it.
I guess I couldn't avoid building a custom block forever. I'll look into it. Thanks
What problem does this address?
I would like to use a library like Alpine.js to build basic interactions in my pattern and parts files. It requires adding directives directly into the html. It also requires adding data into
data-attributes
. Both of these actions causes the edit view to return a "his block contains unexpected or invalid content." error. It works without an issue in browser. It only breaks in the editor.What is your proposed solution?
If would be great if there way a way to indicate that the editor should ignore a piece of code allowing it to pass through to the browser without breaking the editor. This should also work for allowing html to be sent through without requiring the comments that allow it to be editable. For example I may have a template part with some decorative element that I don't want a user to edit. This would allow it to show up with appearing in the list view.
The text was updated successfully, but these errors were encountered: