Skip to content

Instantly share code, notes, and snippets.

@gavinplatt
gavinplatt / nested-neo-vue.twig
Created July 29, 2021 06:47
Passing data to Vue component - texted Neo blocks, nested map filter
{# Get this Neo block's child blocks #}
{% set items = block.children %}
{# Prep items for Vue. Note second level of child blocks #}
{% set itemsPrepped = items.all|map(i => {
label: i.label,
years: i.children.all|map(y => {
value: y.number,
suffix: y.label ?? false
})
slots: {
(screenLg): '560px',
'380px': '380px',
}
/* bad */
blockquote:before {
content: "“"
}
/* good - now the glyph will be rendered*/
blockquote:before {
content: "\201c"
}