Statamic File Structure Tour0:00
Now that we've got a fresh Statamic site to play around with, let me give you the grand tour, starting with the file system. Statamic is structured as a Composer package that's installed into a Laravel application. The newest versions of Statamic 3 support both Laravel 8 and Laravel 9, and follow behind the Laravel release schedule, supporting the most recent two versions. Let me go through and show you all the things that Statamic adds that are not part of the default Laravel install. First Webpack is pre-configured. We also support Vite, so you can switch to that pretty easily as well. Next, the config directory has a subdirectory for Statamic, and this is where all of Statamic's
We also support Vite, so you can switch to that pretty easily as well. Next, the config directory has a subdirectory for Statamic, and this is where all of Statamic's configs live. So if you want to turn on the REST API, you go here. If you want to configure the control panel, change the URL it runs on, that kind of thing, so on. All of those settings happen here. Also additions.php is where you turn on Pro mode. Pro does require a license, but with that off, you can use Statamic for free for as long as you want, and you can use Pro in development for as long as you'd like.
Content Storage Concepts1:42
Next is collections. Collections are a group of entries organized under a particular name, like blog, pages, news, events, that kind of thing. Each one of those would be a collection which is stored in a directory of its own, and then a config file is in YAML on the outside of the main collections directory. Similar for globals, which are global variables available in all of your templates all of the time. Navigation lets you create navs and structures, which are pages like nested underneath each other into a tree. Taxonomies are used for things like categories and tags, and those are all stored here.
Blueprints and Fields2:41
There are 40 plus different types of fields, from markdown and text files to select boxes, toggle switches, all of that are defined here. And the control panel has a whole GUI editor for you, but you can also write the YAML yourself. This default is what collections will use until you configure your own custom blueprints. The user blueprint is what all of your users will use and what fields you like to store on them. And then assets right here is the fields that you want attached to all assets. We start with alt text, but you can add anything else you want, like caption, description, anything like that. Next, we have this users file, and inside here we have settings in YAML for both groups.
anything like that. Next, we have this users file, and inside here we have settings in YAML for both groups and roles. Roles allow you to create and manage permissions for your users, and then those users can be grouped with user groups, and roles can be assigned to the different groups to help you keep track of your users more easily. And finally, we have a users directory. This is where the user files are stored, so you can see here's the user I made for myself. I am super, and you can see my password is all secure and hashed here. One more thing to mention in the resources directory.
Antlers vs Blade Templates3:46
I am super, and you can see my password is all secure and hashed here. One more thing to mention in the resources directory. The views folder, just like Laravel's, is the same, but by default we use our own template engine called antlers. So any files ending in .antlers.html will be parsed with the antlers engine. If you prefer Blade, you can end your files with .blade.php, and it'll run Blade. You can mix and match, you can use a partial or an include that just includes Blade or just includes antlers. It's totally up to you how you organize that. We really like antlers, and there's a lot of things that we've built into the template.
Control Panel Dashboard Widgets5:06
All right. So this first page here is the dashboard. dashboard is a collection of widgets, and the only widget that comes pre-configured is this getting started widget. We go back to the file system, go to config, static, and control panel. Those widgets are all managed right here. So if you wanted to comment out that getting started widget, you would just have this empty dashboard, which isn't terribly useful. We have pre-built widgets for listing your collection entries, for form submissions, free form templates.
Editing Blueprints in GUI8:29
would create and configure those. Now going down into the field section, blueprints is where you can see all of the blueprints that have been created by collection or asset containers or users. They're all organized here. So we can go in, update that page blueprint, and here is where you manage your tabs. So here's your main tab. Here's the sidebar, which is like a special section. You can add another section here called meta SEO, and then you can create fields here. Like a text field called meta title. Maybe we'll make an asset field called meta image.
Like a text field called metaTitle. Maybe we'll make an asset field called metaImage. And we'll say we only need to upload one of those, then we'll hit save. If we go back to our pages collection, edit a page, you'll now see that we have this metaSEO tab. So that's how that works. Field sets are like partials for blueprints. You can create a field set that is shareable across any other blueprint and import them or import fields from them. So if you like to reuse a lot of fields or want to create, you know, one big field set
Updating and Add-ons9:58
You can see the submissions that have been sent in. You can export those to CSV or do other things with them. Updates. This lets you see the latest version of Statamic and we can update to the very latest. You can see today is August or sorry, September 13th and 3.3.36 just came out between when I started recording this episode and now, which is why you see it the little badge up a little bit fortuitous. This is what you'll see when there's a version. By running update to latest, this actually just does a composer update. And when you use the control panel to update composer, it will fix the version to that.
By running update to latest, this actually just does a composer update. And when you use the control panel to update composer, it will fix the version to that specific release until you use another until you click update to latest again or update to a specific version. If you use composer update in the command line, it'll work as usual as long as you haven't used the control panel. So just want to give that little heads up about the constraints. Next year's any add-ons are also composer packages, but some of them are paid. They're commercial, supported by developers like Aardvark, SEO, address field. There's a lot of free ones.
