sapwood

Site Settings

There are three types of settings available within a site:

  • Site Details
  • Image Croppers
  • Custom Settings

Site Details

The hard-coded settings for your site are those that affect the site as a whole and helps Sapwood perform some actions on your site. Here are some details:

Title

The title is an (somewhat) arbitrary name that is mostly used for display purposes in your Sapwood application.

Primary & Secondary Domains

The primary domain is the URL for the site itself. This is really only for the production environment.

For example, if your site's url is sapwood.org, then going to that URL will lead you to the home page of that site if the A-record for that domain is pointing the IP address of the production server. This can be useful for using a staging URL if you are transitioning from an old site to a new site.

The secondary domains will all redirect to the main domain.

Git URL

This is the full URL to the Git repository where the code for the site is hosted.

Home Page

This is where you define the home page of your site. It does nothing other than tell the site which page to load when you go to the root of the domain.

It can be any page on the site.

It is recommended you create your home page first and set this setting right away.

Description

The description is another arbitrary setting. It is only used on your listing of sites, and it will likely be removed in an upcoming version.

Image Croppers

Image croppers define the sizes available when you go to crop images in the media library. Read about the image croppers for more information.

Custom Settings

Previously, these settings were held in the utilities/config.yml file in your project's code. As of v1.4, these settings are now kept within the database.

A site setting has a title, method and value. The title is an arbitrary way to distinguish the setting within your builder. If you leave the method name blank, it will be filled in automatically, but it is the way in which you access the value of the setting.

For example, if your setting is "Twitter URL," the method name will be automatically set as twitter_url. And if your value is "twitter.com/scdavis41", then you can get the url in your site's code by calling:

<%= site_setting('facebook_url') %>