Starting with Statamic CMS

A short log of my initial setup experience and some tips I learnt along the way

Nick Burd
Bootcamp

--

I’ve been a Wordpress developer for the past decade or more. I’ve learnt plenty but over the last short while I’m finding it more cumbersome and annoying than it is helpful. I wanted to move to a simple CMS that still allows me to build from scratch and gives me more control over the template. As a designer and front-end developer I needed something with minimal hassle to setup.

See Statamic.

Screenshot of Statamic’s homepage
Screenshot — Statamic.com

Statamic is a Laravel CMS which allows for deep customization or simple integration. It has a few add-ons available for users to purchase, and some that seem to be free. My initial impression so far, is that I’m going to love working with it, and the way that it’s built is simple enough for most developers to understand (better for those with PHP knowledge though).

For those of you who don’t have in-depth programming skills or have issues, the Statamic forum is great and the responses are generally quick.

Starting my project

I started with the how-to section on Statamic’s website and chose the most bare-bones path as the site I’m building is pretty simple. Statamic requires installing CLI installer to your $PATH to use Composer which is required for Laravel projects. You’ll need to use your command line tool to do the installations so make sure you have it open and install CLI. All these instructions can be found on the Statamic dev site as well.

Make sure composer is installed before starting.

Then download the Statamic CLI installer.

composer global require statamic/cli

Once cli / Statamic is installed, you should be able to start a new project. Unfortunately for me, I ran into a hiccup and my Mac didn’t know where the proper path was so I had to follow some other steps which aren’t noted on the dev site. You can see the info for that here on Stack Overflow incase you need it.

When that error I was receiving was resolved I was able to create a new project. Make sure to change directories into your sites folder, and use the following:

composer create-project — prefer-dist statamic/statamic {site_name}

Viewing your test URL

I had Statamic successfully installed however in the instructions within the Statamic website it didn’t mention that I’d need to configure MAMP in a specific way to view my test URL. In doing this I needed to create a host file in my localhost which was named and directed to the proper document root of the install.

Remember when doing this to point the root to your ‘public’ folder within your install, otherwise you will just end up seeing a document root.

After all of this, I ended up being able to visit the url and received an error which stated “Call to a member function dated() on null”. This was a previous caching error which needed to be solved and could be done through the terminal in your project folder by using:

php artisan cache:clear

Reloading the page now showed my Statamic landing page!

Create a user

Before I could really get started I needed to create a user to access my control panel. Doing this also involved the command line tool, but it’s pretty simple to get through. After entering the proper command, you’re prompted for the user / pass combo to get started. It’s then stored in a document using encryption for the password inside the users folder.

php please make:user

Follow the prompts and you’re finished!

Note: If you decide you need to manually edit your password because you forgot what you entered, make sure to encrypt it using MD5 for security. You can edit that password in the generated file in the users folder.

Screenshot of Statamic template structure
Files structure — Statamic templates

What I did next

My next steps had nothing to do with the Statamic install. But I did make sure to create a proper repository for the project in Github, and I installed NodeJS and Node-watch to compile my Sass.

I’ve started building my site now, and as I’m using Statamic, I’m quite pleased with how flexible the platform seems and look forward to working deeper within the CMS.

I have decided to build custom ‘antlers’ within the templating system they provide, and use the proper structure for navigation and documents. I’m following some of the screencasts to help guide me through the process so that I ensure I’m building as intended, which will help me later on if I need to refresh my memory to make changes.

Conclusion

All-in-all I think I’m on a good path. This is going to help assist in the steps I need to take to improve my business and the services we provide. The intent is to gradually step away from Wordpress as a CMS option as much as possible.

I’ll continue to create articles to help others with the use of Statamic, so clap, follow and share this if you found it helpful.

Did you know if you hold the “clap” button a while, that more people have a chance of seeing this story? — I also have a mailing list if you’d like updates on newly published stories.

--

--

I am a Ui/Ux designer and developer with over 15 years experience. I joined Medium to share with others, and learn from the community.