Skip to content

Instantly share code, notes, and snippets.

@renebakx
Created February 19, 2015 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renebakx/1283b793685da38f8d4d to your computer and use it in GitHub Desktop.
Save renebakx/1283b793685da38f8d4d to your computer and use it in GitHub Desktop.
twig set block
{# If creating a responsive theme, you sometimes need to duplicate content in a template and a macro can be an option but sometimes the overhead is to much #}
{% set loginblock %}
<li><a href="{{ url('login') }}">Log in</a></li>
<li><a href="{{ url('signup') }}">Sign up</a></li>
{% endset %}
... more html...
<ul class="nav nav-secondary">
{{ loginblock }}
</ul>
... even more html...
<ul class="nav nav-secondary nav-mobile">
{{ loginblock }}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment