Skip to content

Instantly share code, notes, and snippets.

@benfurfie
Last active December 4, 2022 23:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benfurfie/6be59c8403edef71f6248b1bde3fee48 to your computer and use it in GitHub Desktop.
Save benfurfie/6be59c8403edef71f6248b1bde3fee48 to your computer and use it in GitHub Desktop.
Statamic 3 Cheatsheet

Statamic 3 Cheatsheet

Antlers

Laravel Mix

To make use of Laravel Mix's versioning functionality in Statamic 3, all you need to do is call the mix tag, and pass in a parameter of src='path/to.css'. For example, let's say your css file is in public/css/app.css, you'd add the following into your antlers file:

<link rel="stylesheet" href="{{ mix src='css/app.css' }}">

Blueprints

Fieldsets

Common Issues

BETA

InvalidArgumentException
View [post] not found.

When loading a particular content type (page, entry, term, etc) and a template hasn't been explicitly defined, Statamic will attempt to load one with the corresponding default template names below.

'views' => [
    'layout' => 'layout',
    'entry' => 'post',
    'term' => 'term',
    'default' => 'default',
],

You will get this error when you create a new structure, and don't define a template AND the default template – in this instance, post – does not exist.

You can either create a new view with the name of the default (e.g. post.antlers.php), or assign a template/view that you've already created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment