Skip to content

Commit dcda2dd

Browse files
jasonvargaduncanmccleanjesseleite
authored
5.0 (#1311)
* add upgrade guide * explain that seeds are removed from shuffle modifier * [5.x] Document Addon Testing (#1258) * Addon Testing docs * Fix tyyo * [5.x] Remove docs for the Antlers Regex Parser (#1242) * Remove docs page for legacy Antlers * Remove links to legacy docs & mention guarded settings * fill in min php/laravel versions, and recommend upgrading * please * nevermind i figured it out * slugs * explain how to use temporary file uploads * Tweak note about supported Laravel versions * [5.x] Update string based validation rules (#1298) * link to upgrade guides so we dont have maintain two identical lists * document rule changes * explain fake sql queries and how to disable them * [5.x] Document new `findOrFail` methods on repositories (#1305) * Tweak wording on "Entry Repository" page * Document `findOrFail` on other repositories * Terms repository: Add note about `findOrFail` now we have a `find` example * bard * helpers are removed * SVG tag: The default value for the `sanitize` parameter is now `true` * [5.x] Multi-site documentation overhaul (#1307) * sites * Tweak sites. * Note on text `direction`. * [5.x] Upgrade Guide: Add note about pagination view changes (#1312) Co-authored-by: Jason Varga <jason@pixelfear.com> * more upgrade guiding * not anymore * escaping params * Move `content/sites.yaml` to `resources/settings/sites.yaml`. See statamic/cms#9857 * Move `resources/settings/sites.yaml` to `resources/sites.yaml`. * Update screenshot, since we moved `Sites` into `Settings` section. * Update `AddonTestCase` import in upgrade guide * Add "Testing in Addons" page to Extending docs (#1323) * Add note to upgrade guide about the new `please` file This will be mostly useful for those upgrading to Laravel 11 using Shift. * Add note to the upgrade guide about the Laravel Shift discount * user role stuff * use async in example * Add sentence about running Statamic without an internet connection * you can disable svg tag sanitization * explain default value behavior change --------- Co-authored-by: Duncan McClean <duncan@duncanmcclean.com> Co-authored-by: Jesse Leite <jesseleite@gmail.com>
1 parent 578cce0 commit dcda2dd

30 files changed

+952
-635
lines changed

content/collections/docs/4-to-5.md

Lines changed: 416 additions & 0 deletions
Large diffs are not rendered by default.

content/collections/docs/antlers-legacy.md

Lines changed: 0 additions & 426 deletions
This file was deleted.

content/collections/docs/antlers.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ blueprint: page
44
title: 'Antlers Templates'
55
intro: |-
66
Antlers is a simple and powerful templating engine provided with Statamic. It can fetch and filter content, display, modify, and set variables, tap into core features like user authentication and search, and handle complex logic. Coming from Laravel and want to stick to Blade? [We got you covered](/blade).
7-
:::tip Hot Tip
8-
For sites running Statamic 3.2 and older you'll need to use the [legacy Antlers parser](/antlers-legacy). For all other projects, keep reading. You're in the right place.
9-
:::
107
template: page
118
---
129
## Overview
@@ -32,13 +29,22 @@ This is a very simple Antlers tag:
3229

3330
### Configuring
3431

35-
You can configure advanced settings (or switch to the [legacy Antlers parser](/antlers-legacy)) in `config/statamic/antlers.php`. The `runtime` version is the fresh new default parser as of Statamic 3.4, as documented on this very page.
32+
You can configure advanced settings, like guarded variables, tags & modifiers in `config/statamic/antlers.php`.
3633

3734
```php
3835
// config/statamic/antlers.php
3936
return [
40-
'version' => 'runtime',
41-
// ...
37+
'guardedVariables' => [
38+
'config.app.key',
39+
],
40+
41+
'guardedTags' => [
42+
//
43+
],
44+
45+
'guardedModifiers' => [
46+
//
47+
],
4248
];
4349
```
4450

@@ -375,10 +381,6 @@ There are more than 150 built-in [modifiers](/reference/modifiers) that can do a
375381

376382
You can even create [Macros](/modifiers/macro) to combine sets of often used modifiers into one, new reusable one.
377383

378-
#### Legacy Syntax
379-
380-
The New Antlers Parser still supports what we're now calling the "[Legacy Syntax](/antlers-legacy#stringshorthand-style)" styles, and will continue to do so until Statamic 4.0.
381-
382384
### Creating Variables
383385

384386
You can now set variables by using the assignment operator, `=`.
@@ -1283,6 +1285,14 @@ The `@` can also be used to escape individual braces within tag parameters or st
12831285
// "string {foo} bar"
12841286
```
12851287

1288+
### Tag parameters
1289+
1290+
You may ignore the contents of tag parameters by prefixing the parameter with a backslash. This could be useful allow you to avoid having to escape each curly brace like the example above if you are providing some JS/JSON in a parameter:
1291+
1292+
```
1293+
{{ form:create \x-data="{ submittable: false }" }}
1294+
```
1295+
12861296
### The `noparse` Tag
12871297

12881298
Use this method if you need to prevent entire code blocks from being parsed.

content/collections/docs/debugging.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ Statamic will try to detect why you're receiving a specific exception and provid
2020

2121
<img src="/img/clippy-docs.gif" class="fixed z-10 cursor-pointer bottom-0 right-0 m-8" x-show.transition="showEasterEgg" x-on:click="showEasterEgg = false">
2222

23+
24+
## Fake SQL Queries
25+
26+
By default, Statamic doesn't use a database, so our query builders don't actually execute SQL queries. However, we "fake" the queries so that they appear in your preferred debugging tools like [Ray](https://myray.app) or Debugbar (more on that below).
27+
28+
They are enabled when you're in debug mode, but if you'd like to disable them you can do so in `config/statamic/system.php`:
29+
30+
```php
31+
'fake_sql_queries' => false,
32+
```
33+
34+
2335
## Debug Bar
2436

2537
The debug bar is a convenient way to explore many of the things happening in any given page request. You can see data Statamic is fetching, which views are being rendered, information on the current route, available variables, user's session, request data, and more.

content/collections/docs/forms.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ email:
365365
# other settings here
366366
```
367367

368+
If you don't want the attachments to be kept around on your server, you should pick the `files` fieldtype option explained in the [File Uploads](#file-uploads) section.
369+
368370
### Using Markdown Mailable Templates
369371

370372
Laravel allows you to create email templates [using Markdown](https://laravel.com/docs/mail#markdown-mailables). It's pretty simple to wire these up with your form emails:
@@ -413,15 +415,15 @@ You can customize the components further by reviewing the [Laravel documentation
413415

414416
Sometimes your fans want to show you things they've created, like scissor-cut love letters and innocent selfies with cats. No problem! File input types to the rescue. Inform Statamic you intend to collect files, specify where you'd like the uploads to go, and whether you'd like them to simply be placed in a directory somewhere, or become reusable Assets.
415417

416-
First up, add `files="true"` to your form tag. (This will add `enctype="multipart/form-data"` to the generated `<form>` tag. That's always so difficult to remember.)
418+
First, add a file upload field to your blueprint:
419+
- Add an `assets` field if you want the uploaded files to be stored in one of your asset containers.
420+
- Add a `files` field if you're only wanting to attach the uploads to the email. Anything uploaded using this fieldtype will be attached and then deleted after the emails are sent.
417421

418-
```
419-
{{ form:create formset="contact" files="true" }}
420-
...
421-
{{ /form:create }}
422-
```
422+
Then decide if you need single or multiple files to be uploaded.
423+
424+
### Single files
423425

424-
Then add an `assets` field to your blueprint, with a `max_files` setting of `1`:
426+
On your field, add a `max_files` setting of `1`:
425427

426428
```
427429
<input type="file" name="cat_selfie" />
@@ -443,7 +445,7 @@ You have two methods available to you:
443445
444446
First, You can create separate fields for each upload. This is useful if each has a separate purpose, like Resume, Cover Letter, and Headshot. You'll need to explicitly create each and every one in your formset.
445447
446-
Or, you can enable multiple files on one field by dropping the `max_files` setting on your assets field, and using array syntax on your input by adding a set of square brackets to the `name` attribute:
448+
Or, you can enable multiple files on one field by dropping the `max_files` setting on your field, and using array syntax on your input by adding a set of square brackets to the `name` attribute:
447449

448450
```
449451
<input type="file" name="selfies[]" multiple />

content/collections/docs/laravel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You'll get a bunch of things automatically set up for you, like a pages collecti
2424

2525
## Supported Versions of Laravel
2626

27-
**Laravel 9 and Laravel 10 are supported with Statamic 4+.** If you need Laravel 8 support, you can still use Statamic 3.x.
27+
**Laravel 10 & Laravel 11 are supported with Statamic 5.** If you need Laravel 9 support, you can still use Statamic 4.x.
2828

2929
## Install Statamic
3030

content/collections/docs/licensing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Statamic pings The Outpost (our validation web service) on a regular basis. The
6262

6363
This happens once per hour, and only when logged into the control panel. Changing your license key setting will trigger an immediate ping to the The Outpost. Tampering with outgoing API call will cause Statamic to consider your license invalid. If that happens, you'll need to open a [support request][support] to reinstate your license.
6464

65+
If you need to run Statamic in an environment without an internet connection, please [contact support](https://statamic.com/support).
66+
6567
## One License Per Site
6668

6769
Each license entitles you to run one production installation. You will need to specify the domains you plan to use from the "Sites" area of your Statamic Account. Domain are treated as wildcards so you can use subdomains for locales, testing, and other purposes.

0 commit comments

Comments
 (0)