Markdown + Maizzle: Is it possible for Markdown Expressions to be evaluated for props before the props are passed into HTML components? #1536
Unanswered
xiaolongbytes
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hi, you're not passing in the Front Matter variables correctly to the component (it's not related to Markdown). This works fine: emails/template.html ---
firstName:
value: beans
vehicles:
value:
- vehicle: 1965 Dodge Deora
- vehicle: 1971 Ford De Tomaso Pantera
---
<x-main>
<x-example title="{{ page.firstName.value }}" />
</x-main> components/example.html <script props>
module.exports = {
title: props.title || 'Example Component',
}
</script>
<p>
{{ title }}
</p> Result: <p>
beans
</p> You have By the way, always use quotes for attributes, this isn't JSX and you can end up with unexpected results. - <moose-ayw-alert aware:title={{someVar}} />
+ <moose-ayw-alert aware:title="{{someVar}}" /> Finally, if you want to loop over data like |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Desired Behavior:
{{firstName}}
) is being passed into the html component instead of the evaluated expression.Code Examples:
Markdown file:
ayw-alert html component:
(For demonstration purposes only)
Current (but not desired) Result after

maizzle serve
You can see that the {{firstName}} and {{vehicle}} expressions outside of the component render correctly, but that the
ayw-alert
component receives the values "{{firstName}}" and "{{vehicle}}" instead of the corresponding values in the Front Matter.I didn't see the answer in https://maizzle.com/guides/markdown-emails#compile-markdown or https://maizzle.com/docs/events
Beta Was this translation helpful? Give feedback.
All reactions