Skip to content

Instantly share code, notes, and snippets.

@croxton
Last active April 8, 2018 02:24
Show Gist options
  • Save croxton/7a65e229dde7a1dee869c95f162946e4 to your computer and use it in GitHub Desktop.
Save croxton/7a65e229dde7a1dee869c95f162946e4 to your computer and use it in GitHub Desktop.
GeeUp Workshop

#GeeUp workshop

These instructions will help you set up the EE Zen Garden locally and you should end up with a working website.

Initial set up

  1. Fork croxton/ee_zen_garden on Github

  2. Make a local clone of your fork:

     git clone [email protected]:my-account/ee_zen_garden.git
     cd ee_zen_garden
    
  3. Add croxton/ee_zen_garden as a git remote:

     git remote add upstream https://github.com/croxton/ee_zen_garden.git		
    
  4. Create and checkout a new 'geeup' branch in your clone, and create your branch from the develop branch of the upstream repo:

     git fetch upstream
     git checkout -b geeup upstream/develop
    
  5. Download and install a fresh copy of ExpressionEngine 3 in the root directory of your local clone, following the insallation instructions.

  6. Edit /system/user/config/config.php and add these lines:

     $config['save_tmpl_files'] = "y";
     require $_SERVER['DOCUMENT_ROOT'] . '/vendors/croxton/stash_template_inheritance/config/config.custom.php'; 
    
  7. In the same file, scroll down to $config['encryption_key'] = ""; and enter a unique value for the key.

  8. Copy /vendors/croxton/stash_template_inheritance/_htaccess to the ee_zen_garden root directory and rename as .htaccess

  9. Delete the existing templates folders /system/user/templates. Create a symlink to the templates folder at /vendors/croxton/stash_template_inheritance/templates, e.g.:

     ln -s ~/Sites/ee_zen_garden/vendors/croxton/stash_template_inheritance/templates ~/Sites/ee_zen_garden/system/user/templates
    

    If you already have a symlink to somewhere else and need to change it:

     ln -nfs ~/Sites/ee_zen_garden/vendors/croxton/stash_template_inheritance/templates ~/Sites/ee_zen_garden/system/user/templates
    

    (Note: make sure you update the paths above with the actual path on your system. If you have changed the site short name from "default_site" to something else, please rename the default_site template folder accordingly.)

  10. In the CP go to Template Manager, and check that the templates appear. If not, create a new template group Blog and save, this should force EE to sync the template files.

  11. Click on the Blog template group, click the edit button, then check 'Yes' for Make default group?.

  12. Go to System Settings > Template settings and set the following:

    • Enable Strict URLs: 'Yes'
    • 404 Page: site/404

Install add-ons

First-party
  • Email
Third-party: essential
Third-party: optional

Create file upload locations

  • Images
    • Server path: /images/uploads/
    • URL of upload Directory: /path/to/ee_zen_garden/images/uploads/

Create field groups

Post
  • Subtitle (post_subtitle) - Text input
  • Body (post_body) - Textarea (Rich Text)
  • Image (post_img) - File, set to 'Images' file upload location

Add a category group

Create a category group 'Blog' (ID 1) and add categories as follows, adding a description and assigning an image to each:

  • Animals
  • Beards
  • Beer
  • Brighton
  • Cheesy peas
  • Featured
  • Idoltry
  • In depth
  • Reginald P. Horse
  • Sausages
  • Space monkeys
  • Tentacles

Add channels

  • Blog (channel ID 1) - assigned to the 'Posts' fieldgroup and 'Blog' category group
  • Pages (channel ID 2) - assigned to the 'Posts' fieldgroup

Entries

Pages

Create the following entries (url_title in brackets), populating the fields with the appropriate text and image as per the original source pages:

  • About (about)
  • Archive (archive)
  • Contact Me (contact)
  • EE Zen Garden (home)
  • Page Not Found (page-not-found)
Blog

Publish a few random entries - anything you like - and assign to one or more categories.

Member data

  • Go to Admin > Settings > Avatars and set max width to 1200, max height to 800 and max file size to 1024.
  • Go to Members > Member fields and create
    • Strapline (mf_strap) - Text input
    • Telephone (mf_telephone) - Text input
  • Now go to your Account > My profile page and fill in the fields.

Mustash (optional)

  • On the Settings screen, enable the Channel Entries, Categories and API plugins.
  • On the same screen, enter an API key (up to 32 character random string) and make a note of the Cache pruning URL displayed there.
  • On the Rules screen add these cache-breaking rules:
Hook Group Bundle Scope Pattern Comment
Channel Entries: all hooks Blog Static Site #^blog/{url_title}:static$# Single blog post entry
Channel Entries: all hooks Pages Static Site #^{url_title}:static$# Single page entry
Channel Entries: all hooks Pages Static Site #^\[index\]:{url_title}:static$# Homepage
Categories: all hooks Blog Static Site #^blog/category/{cat_url_title}:static$# Blog category listing
  • Add a CRON to prune the cache periodically by pinging the pruning URL you noted earlier. E.g.:

      */15 * * * * wget -qO- 'http://ee_zen_garden.dev/?ACT=123&key=456&prune=1' >/dev/null 2>&1
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment