Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Delicious tutorials. 

Interested in headless CMS?

Check out our new video series on Silverstripe CMS + NextJS!

Versions

All tutorials (22 articles)

Up and Running: Setting up a local SilverStripe dev environment

In this introductory lesson, we cover installing a local webserver (e.g. MAMP), installing and using Composer, and configuring an .env file. Having a finely tuned local...

Creating your first project

In this tutorial, we’ll cover how to build your first theme in SilverStripe. The SilverStripe installer ships with its own default theme -- Simple, but more...

Migrating static templates into your theme

In this tutorial, we’ll migrate a static site into your SilverStripe project. HTML, CSS, and JavaScript will provide a nice common ground and starting point for...

Adding Dynamic Content

In this tutorial, we’ll start using SilverStripe’s native template syntax to inject dynamic content into our site, such as navigation, page titles, CMS content, and...

Working with Multiple Templates

Typically a site has more than one distinct template used across all pages. The home page, for instance, is likely to have a different layout than...

The holder/page pattern

In this tutorial we’re going to focus on the Travel Guides section of our website for this topic. As we can see in the designs, there...

Adding custom fields to a page

In the previous lesson, we developed a structure for our Travel Guides section that provides a list view of articles, each with a link to their...

Working with Files and Images

In the previous lesson, we started adding some basic custom fields to our Article pages. We’ll now continue working on getting those pages more integrated with...

Introduction to the ORM

In this lesson, we’ll use the backbone of SilverStripe Framework -- the Object Relational Model (ORM) to syndicate content to the home page of our...

Working with data relationships - $has_many

In this lesson, we're going to dig a bit deeper into relational data by introducing some plural relationships with $has_many.

Working with data relationships - $many_many

In this tutorial, we'll add categories to our articles using another type of plural data relationship known as $many_many.

Introduction to frontend forms

In this tutorial we're going to look at adding forms to the frontend of our website. We'll add a new feature that allows users to post...

How to use this guide

What are we building?

These tutorials are published in series, with each lesson demonstrating a new concept in SilverStripe development. To give them context, we have created an imaginary client that we’ll be working for, who needs a custom web application. Their application will allow users to book and list holiday rentals, much like HomeAway or AirBnB, only to give it an element of distinction, all the listings are in Middle Earth. The name of the website is appropriately One Ring Rentals.

Prerequisites

You should have a basic working knowledge of object-oriented PHP and MySQL. If you're new to PHP, we recommend Sitepoint. Since the project assumes that a designer has already done all of our HTML and CSS, there will be very little, if any, frontend work.

The format

Each lesson includes a screencast and a written tutorial. They follow each other very closely, and in general, share all the same information. Lessons move through the project in a linear fashion, putting most of the advanced topics further down the track.

Getting the source code

The source code for every lesson is on Github. Each lesson contains a link to its respective subdirectory in the repository. Lessons are subdivided into "begin" and "end" states, where the "begin" directory is the state of the code before the lesson begins, and the "end" is how it should look when the lesson is complete.

For example, if you're working on Lesson 11, you'll want to go to the "Lesson-11-begin" directory, run "composer install" and follow the tutorial. If you get stuck, or if you want to compare your work to the final outcome, go to the directory "Lesson-11-end".

Getting a copy of the tutorial

All the tutorials are published online, here in this section, but if you want a local copy, you'll find them all in the "__tutorials" directory in the source code repository. 

Getting the database and assets

Each lesson contains a folder named "__assets/" that contains any static files that are relevant to the lesson, as well as the current database. Additionally, uploaded assets (e.g. files added via the CMS) are included in "__assets/assets" (Yes, we are aware how confusing that may seem.) Typically, to get the content into the right state to begin the lesson, you'll want to overwrite your project "assets/" folder with "__assets/assets/" and import the database.sql file to your database. All database clients, such as PHPMyAdmin, Navicat, and Sequel Pro allow you to import SQL scripts very easily. You can also run the script from the command line, using

mysql -u [user] -p[password] [database_name] < __assets/database.sql

Getting support

The SilverStripe Community Slack channel, the SilverStripe Forum, and Stack Overflow (tagged SilverStripe or SilverStripe 4) should be your first point of call for any questions you may have. For more information about the various ways of connecting with the SilverStripe community refer to our Contributing guides.