Created
July 13, 2020 13:11
-
-
Save cherrykoda/27e9fbe868764ae9d73fc013af5a3df2 to your computer and use it in GitHub Desktop.
[Medium] Macros v Partials - Macro Scoping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# Define Page #} | |
{% set bodyClass = "article" %} | |
{% extends "_layouts/main" %} | |
{# Includes #} | |
{% import "_macros/designer.twig" as _designer %} | |
{% import "_macros/actions.twig" as _actions %} | |
{% import "_macros/ads.twig" as _ads %} | |
{% block content %} | |
// Article Content Markup Goes Here | |
{% embed '_components/_mobile-menu' %} | |
{% block menu %} | |
{# macro redefined for menu block (scoping) #} | |
{% import "_macros/actions.twig" as _actions %} | |
// Mobile Menu Markup Goes Here | |
{% endblock %} | |
{% endembed %} | |
{% endblock %} | |
{% block footerJs %} | |
// Javascript Goes Here | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment