Skip to content

Project Foundation Guide

Maria Fisher edited this page Jul 27, 2016 · 20 revisions

#Project Foundation Guide

Project Prep

  • Clone ts_build into a new project directory
git clone git@github.com:thinkshout/ts_build.git project_name
  • Run the bootstrap script to rename ts_build to your new distro name
cd project_name; composer install; ./scripts/bootstrap.sh project_name
  • Go into the settings/config.sh file.
    • Alter ‘PROJECT=ts_build' to match your project’s name ‘PROJECT=project_name'.
  • Add module version information to project_name.make file.
  • Add .gitignore file to repo and include appropriate libraries and module directories to be ignored.
  • In project_name, create a folder called themes/custom. Add https://www.drupal.org/project/basic to the custom folder and where needed, change "basic" and "Basic" to whatever you want to call your custom them. Consider naming this to avoid conflicts with project_name.

Add to GitHub

  • In project_name, rm -rf .git and git init and commit what you've done so far.
  • On the ThinkShout GitHub account, create a new repository.
  • Push to the new repo you created on GitHub.

Build a working site

  • Make a new MySQL database called project_name.
  • In project_name, ./scripts/build.sh ~/Sites/project_name mysql_user mysql_pass project_name. The script will generate a username and password for your first login.
  • In ~/Sites/project_name, modify .htaccess to uncomment RewriteBase /.
  • If you've lost the login info, you can drush uli --uri=project_name.dev.

Features and Configuration

  • Make a project_common Feature module.
    • Add site wide configurations here.
  • Create a “Page” Content type, for Basic Pages.
    • Create a project_fields Feature module to store field bases.
    • Create a project_page Feature module to store field instances.
  • Add Menus, if necessary.
    • Export new custom menus into project_common module

Migrate

  • Copy a content spreadsheet for your migration.
  • On Google spreadsheets, go to File > Publish to the web… and make sure your migration has access to the data.
  • Add a site_migrate module. (Model after another TS project, like reDesign)
    • Configure to your project's name and mappings.
    • In the site_content.module file (where SITE_MIGRATE_SOURCE_URL is defined), replace the tokenized portion of your google spreadsheet url with the one that currently exists.
  • Create an includes directory inside of your site_migrate module.
    • Create a migration for Basic Pages, i.e. MigrateBasicPages.inc.
      • Add appropriate mapping
      • Go to path admin/content/migrate in your local dev environment, and migrate Basic Pages.
    • Create a migration for Menu Links, i.e. MigrateMenuLinks.inc.
      • Use a previous projects code to add proper mapping.
      • Go back to your local environment and migrate the menu links.

404 Page

  • If you’re using a migration, you can use it to create a basic 404 page. Or, you can create a new item with the “page” content type. Either way, set the URL to something like 404 or 404-error.
  • After you've created a page that maps to the URL "404" (or similar), go into admin/config/system/site-information.
  • Add "404" (or the URL you used) to the default 404 settings.
  • Export site_404 to project_common feature module.

Front/Home page

  • If you’re using a migration, you can use the “Menu Links” migration to create a front page. Or, you can create a new “Home” menu item with as the Path.
  • Export site_frontpage to project_common feature module.

Set Custom Theme

  • Go into admin/appearance.

    • Select “Enable and set default” on custom theme.
    • Disable Bartik theme, if necessary.
  • Export admin_theme, theme_default, and node_admin_theme strongarm variables to project_common feature module.

  • Go into the project_name.install file.

    • Add this to the bottom, just above minimal_install():
// Set default theme.
theme_enable(array('project_theme'));
theme_disable(array('bartik'));

Set Default Timezone

  • Go into the project_name.install file.
    • Look for // Set the timezone and change the value, as necessary.
  • Export date_default_timezone strongarm variable to project_common feature module.

WYSIWYG Config

  • Add ckeditor (revision 32f0973) by adding the following to to drupal-org.make:
; ckeditor
;projects[ckeditor][version] = "1.17"
; use latest dev commit due to https://www.drupal.org/node/2455391
projects[ckeditor][download][type] = git
projects[ckeditor][download][branch] = 7.x-1.x
projects[ckeditor][download][revision] = 32f0973
projects[ckeditor][subdir] = contrib
  • In admin/config/content/formats, add the rich_text format.
  • At admin/config/content/linkit, add a linkit profile that will act on the rich_text format-enable node and taxonomy term search plugins. Choose "aliased".
  • Create a Content Authoring feature and save the WYSIWYG settings to that (check Strongarm variables).
  • Configure the ckeditor bar to include reasonable options.
  • Add media and media_ckeditor modules to embed media images and files into the WYSIWYG.

Set up a Pantheon project

Directions (in progress).

Clone this wiki locally