-
Notifications
You must be signed in to change notification settings - Fork 968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling partial without adding surrounding HTML tags #459
Comments
Hi there, First, I would like to know the use case of such an option ? To me, a component like |
Hi! Yeah, that makes sense. I'm rendering the compiled partial through Twig, which itself extends a parent template. I suppose a better solution would be to add support for inheritance in MJML. |
I don't know how twig works, but you should apply all twig variables & conditionnal structures to it and then pass it to the MJML engine ? ( Twig -> MJML -> HTML ) |
Thank you for the feedback; I attacked the problem from the wrong direction. |
I think this is a valid request. |
Just do a div inside mj text or use any html tag inside it ? Most of
content tag within allow html.
…On Sun, Apr 28, 2019 at 5:36 PM Nathan ***@***.***> wrote:
I think this is a valid request.
We send specially id'd
s to the client that can be Rich text edited, but the default html in such
a div is generated by mjml.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#459 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAELHTNC4RMIT6JCCRBH63DPSXAATANCNFSM4CYQO7TA>
.
|
Couple examples:
Is there a way to make this work? I tried using mjml2html for the default and ran into this issue thread |
Yeah so basically it's not related to this issue, you most likely want #200
instead. And I don't think it add too much overhead to add a simple div
inside a mj-text ? https://mjml.io/try-it-live/H1KorU7iN it compiles just
fine and I don't see any issue
…On Sun, Apr 28, 2019 at 5:53 PM Nathan ***@***.***> wrote:
Couple examples:
<mj-text> //cannot put custom attributes on mj components
<div editable=true database-field='customTitle'>
{{#if customTitle}}
{{{customTitle}}}
{{else}}
{{{insert some default html here}}} //ideally an mjml partial
{{/if}}
</div>
</mj-text>
Is there a way to make this work? I tried using mjml2html for the default
and ran into this issue thread
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#459 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAELHTPUIOQB32NHLXLC6Y3PSXB6FANCNFSM4CYQO7TA>
.
|
concerning the |
Hi, great work -- makes my life a lot easier!
I have a partial MJML-file which I'd like to render (without a parent) without the surrounding HTML tags. I tried rendering it without the parent
mj-body
/mjml
-tags, but that doesn't seem to be valid syntax.Reproduction Steps:
Compile the following partial MJML-file:
Expected behavior:
Generates only the relevant HTML-code for a partial:
Observed behavior:
Generates the full HTML, with surrounding HTML tags:
Perhaps a
--partial
flag would be a good idea?The text was updated successfully, but these errors were encountered: