Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

This course is the most refreshing take on teaching design that I've come across.

— Mikaël Sévigny, Developer

Scope Tag

Used to push all of the "root", or page scope data into an array to be used however you see fit.

Overview

Most commonly this take is used to avoid any kind of variable collisions or to confirm data to a particular naming mechanism. Scoping is most often done on the Tag level (e.g. the Collection Tag), but gives you another level of control and flexibility.

Example

---
title: Grimmace Shake
---
 
{{ scope:stuff }}
<h1>{{ stuff:title }}</h1>
{{ /scope:stuff }}
<?php
$title = 'Grimmace Shake';
?>
 
<s:scope:stuff>
<h1>{{ $stuff['title'] }}</h1>
</s:scope:stuff>

This will output:

<h1>Grimmace Shake</h1>

Parameters

scope

tag part

The name of the scope while. This is not a parameter, but part of the tag itself. For example, {{ scope:plop }}.

Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →