#GeeUp workshop
These instructions will help you set up the EE Zen Garden locally and you should end up with a working website.
-
Fork croxton/ee_zen_garden on Github
-
Make a local clone of your fork:
git clone [email protected]:my-account/ee_zen_garden.git cd ee_zen_garden
-
Add croxton/ee_zen_garden as a git remote:
git remote add upstream https://github.com/croxton/ee_zen_garden.git
-
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
-
Download and install a fresh copy of ExpressionEngine 3 in the root directory of your local clone, following the insallation instructions.
-
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';
-
In the same file, scroll down to
$config['encryption_key'] = "";
and enter a unique value for the key. -
Copy
/vendors/croxton/stash_template_inheritance/_htaccess
to the ee_zen_garden root directory and rename as.htaccess
-
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.) -
In the CP go to
Template Manager
, and check that the templates appear. If not, create a new template groupBlog
and save, this should force EE to sync the template files. -
Click on the
Blog
template group, click the edit button, then check 'Yes' forMake default group?
. -
Go to
System Settings > Template settings
and set the following:- Enable Strict URLs: 'Yes'
- 404 Page: site/404
- Images
- Server path: /images/uploads/
- URL of upload Directory: /path/to/ee_zen_garden/images/uploads/
- Subtitle (post_subtitle) - Text input
- Body (post_body) - Textarea (Rich Text)
- Image (post_img) - File, set to 'Images' file upload location
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
- Blog (channel ID 1) - assigned to the 'Posts' fieldgroup and 'Blog' category group
- Pages (channel ID 2) - assigned to the 'Posts' fieldgroup
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)
Publish a few random entries - anything you like - and assign to one or more categories.
- 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.
- On the
Settings
screen, enable theChannel Entries
,Categories
andAPI
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