A fork of Happy Lager, the official Pixel and Tonic Craft Demo site, modified to follow a modular template architecture.
The modified templates follow the same Router-View-Component-Layout architecture as presented in the talk “Architecting a Content Website” at Dot All Conf 2018. You can watch the talk video, or browse through the slides for further information.
The website features and behaviour is pretty much identical to the orginal demo site, and minimum code changes have been made to reflect the spirit of Router-View-Component-Layout architecture. Only template paths have been modified in the database.
Please report any glaring issues, or suggestions.
Brought to you by Miranj.
Craft demo site
This repo contains all of the templates, front-end resources, and a MySQL database backup for “Happy Lager”, a Craft demo site.
You can find out more about Craft at craftcms.com.
Happy Lager takes advantage of several Craft features:
The content in Happy Lager is managed from the following sections:
- Four “Single” sections:
- Services Index
- Work Index
- Two “Channel” sections:
- Two “Structure” sections:
The News section has two entry types:
- Article – used to store news articles
- Link – used to store links to articles on other websites
This site has the following Matrix fields:
- Article Body – used to store the varying content of the About page and News, Services, and Work entries.
- Contact Methods – used to store Locations’ various contact methods.
- Services Body – used to store information about the Services.
- Testimonials – used to store the Homepage testimonials.
This site has the following relational fields:
- Services Performed (Entries) – used to relate Work entries to the relevant Services entries.
- Client Logos (Assets) – used to related the Homepage to the logos that should be displayed in the “Our Best Drinking Buddies” section.
- Featured Image (Assets) – used to relate a featured image to News, Work, Services, and Locations entries.
- Featured Thumb (Assets) – used to relate a featured thumbnail to Work entries.
- Hero Image (Assets) – used to relate a hero image to the Homepage.
- Service Icon (Assets) – used to relate an icon to Services entries.
- There are additional Assets fields within the “Article Body” and “Service Body” Matrix fields.
This site has the following asset volumes:
- Site Assets – used to store all miscellaneous site imagery.
- Company Logos – used to store the company logos that are displayed on the Homepage.
- Service Icons – used to store Services’ icons.
You can check out Happy Lager online from demo.craftcms.com.
If you want to install the site locally, follow these instructions:
Download/clone the repo on your computer:
git clone https://github.com/craftcms/demo.git happylager.test
composer installwithin the clone:
cd happylager.test composer install
.envfile at the root of the project with the following contents, and then update the
DB_PASSWORDvalues to your database user’s credentials.
ENVIRONMENT="dev" SECURITY_KEY="GoplVO9SzWSYLIvNuDBQP9M-LEJN5EWA" DB_DRIVER="mysql" DB_SERVER="localhost" DB_USER="" DB_PASSWORD="" DB_DATABASE="happylager" DB_TABLE_PREFIX="" DB_PORT="3306"
Ensure that the following files and directories have permissions that will allow PHP to read and write to them:
Create a new MySQL database called
happylager, and import
Create a new virtual host with the hostname
happylager.testthat points to the
Edit your hosts file to resolve
127.0.0.1, if necessary.
Now point your browser at
http://happylager.test. You should see the Happy Lager homepage.
The Craft Control Panel is located at
http://happylager.test/admin. You can log in with the following credentials: