joetannenbaum/antlers-stack-tags

There is no license information available for the latest version (0.1.0) of this package.

Provides push, prepend, and stack tags to Antlers templates

Maintainers

Package info

github.com/joetannenbaum/statamic-antlers-stack-tags

pkg:composer/joetannenbaum/antlers-stack-tags

Statistics

Installs: 26 720

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 1

0.1.0 2021-01-05 13:31 UTC

This package is auto-updated.

Last update: 2026-03-06 01:12:41 UTC


README

Provides stack tags for Antlers templates in Statamic. Works very similarly to Blade stack directives:

Push a script onto the scripts stack:

{{ push:scripts }}
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js"></script>
{{ /push:scripts }}

Prepend a script onto the scripts stack:

{{ prepend:scripts }}
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js"></script>
{{ /prepend:scripts }}

Push a script onto the scripts stack, but only do it once (similar to Blade once directive):

{{ push:scripts once="true }}
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js"></script>
{{ /push:scripts }}

Output stack:

{{ stack:scripts }}

Stacks can be named anything and you can have as many stacks as you want.