Skip to content

Instantly share code, notes, and snippets.

@splagemann
Forked from karlhorky/include_when.twig
Last active March 9, 2016 18:29
Show Gist options
  • Save splagemann/3129d2bc987b9b92f5d6 to your computer and use it in GitHub Desktop.
Save splagemann/3129d2bc987b9b92f5d6 to your computer and use it in GitHub Desktop.
Demo of potential include_when Twig tag
{% include_when {
'config.azubiTabs': 'azubi-tabs.twig'
} %}
{% include_when {
'config.hasCustomFooter': 'layouts/#{locale()}/footer.twig',
default : 'layouts/footer.twig'
} %}
{% include_when {
'config.hasHomeDialog: 'layouts/#{locale()}/dialog.twig'
} %}
{% include_when {
'config.hasCustomHome': "index/#{locale()}/index.twig",
default : "index/index.twig"
} %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment