SiteFarm Local Development and Subtheming

This documentation is for anyone who has the desire or need to run a SiteFarm site locally and/or desires to create and manage a custom subtheme for a SiteFarm site. Reason for wanting to do this can range from needing to debug an issue with your site to wanting to include custom CSS, JS, CSS libraries, JS libraries, process or preprocess TWIG templates, add or override TWIG template, or just to learn more about how all this works. 

We will be walking through the following activities.

  • Configuring a local copy of SiteFarm on your computer
  • Creating a SiteFarm Subtheme from one of our 2 starter templates
  • Instructions on how to subtheme using our 2 starter templates
  • Creating a code repository for your custom subtheme
  • Connecting your code repository with your subtheme to your SiteFarm site
  • How to continue to manage your local SiteFarm environment over time
  • How to use template debugging to do advanced subtheming
  • How to use XDebug for advanced PHP debugging

 

We assume you are familiar with the following basic front end development skills.

These are the basic languages that are needed to do basic front end development. You will need these skills to create and manage a subtheme.

  • HTML (Hyper Text Markup Language)
  • CSS (Cascading Style Sheets)
  • JS (Java Script)
  • Git code management (Code version tracking)
It would be helpful if you are familiar with...

These languages are core to Drupal development and subtheming, but you can probably get by with minor subtheming without having any advanced knowledge. Cursory knowledge or rough familiarity is preferred.

  • Twig Templates (PHP Templating Language used by Drupal)
  • PHP (PHP Hypertext Preprocessor)
  • Drupal (CMS)
  • YML (Configuration management in Drupal)
We assume you have the following technologies.

The following are hardware and software requirements to follow along with the following documentation and to configure a local environment. While a Mac is not required, it is what we use and will be using for the documentation. Development in a Windows environment will require you to translate these instructions and technologies to something PC appropriate.

  • A Mac. Our entire team works primarily on a Mac. Attempting this process on a Window machine will require you to do some trouble shooting for particular technologies along the way.
  • Git (on a mac this can be installed individually or by installing XCode (recommended))
  • Docker
  • Docksal
  • An IDE like PHP Storm or VS Code
  • A command line interface