All Projects → barrelstrength → Craft Master

barrelstrength / Craft Master

Licence: mit
A custom, multi-environment setup and example templates for Craft CMS

Labels

Projects that are alternatives of or similar to Craft Master

Guest Entries
Accept anonymous entry submissions with Craft.
Stars: ✭ 100 (-37.89%)
Mutual labels:  craftcms
Craft Cpcss
Control Panel CSS plugin for Craft CMS
Stars: ✭ 115 (-28.57%)
Mutual labels:  craftcms
Docs
Craft CMS documentation
Stars: ✭ 136 (-15.53%)
Mutual labels:  craftcms
Craft Preparse Field
Field type that parses twig when an element is saved.
Stars: ✭ 103 (-36.02%)
Mutual labels:  craftcms
Minify
DEPRECATED A simple plugin that allows you to minify blocks of HTML, CSS, and JS inline in Craft CMS templates
Stars: ✭ 111 (-31.06%)
Mutual labels:  craftcms
Craft Blitz
Intelligent static page caching for creating lightning-fast sites with Craft CMS.
Stars: ✭ 118 (-26.71%)
Mutual labels:  craftcms
Buttonbox
A collection of utility field types for Craft
Stars: ✭ 94 (-41.61%)
Mutual labels:  craftcms
Commerce
Fully integrated ecommerce for Craft CMS
Stars: ✭ 144 (-10.56%)
Mutual labels:  craftcms
Ontherocks
Stars: ✭ 111 (-31.06%)
Mutual labels:  craftcms
Craft Seomatic
SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
Stars: ✭ 135 (-16.15%)
Mutual labels:  craftcms
Craft Quick Field
Create fields on the fly while designing field layouts
Stars: ✭ 104 (-35.4%)
Mutual labels:  craftcms
Plugins
The master list of Craft 3-compatible plugins
Stars: ✭ 111 (-31.06%)
Mutual labels:  craftcms
Craft
Composer starter project for Craft CMS
Stars: ✭ 122 (-24.22%)
Mutual labels:  craftcms
Instantanalytics
DEPRECATED Instant Analytics brings full Google Analytics support to your Twig templates and automatic Craft Commerce integration with Google Enhanced Ecommerce.
Stars: ✭ 103 (-36.02%)
Mutual labels:  craftcms
Simplemap
A beautifully simple map field type for Craft CMS.
Stars: ✭ 136 (-15.53%)
Mutual labels:  craftcms
Craftcms Docker
Craft3/Craft2 CMS Docker base (Nginx, PHP-FPM 8, PostgreSQL/MariaDB, Redis)
Stars: ✭ 99 (-38.51%)
Mutual labels:  craftcms
Mailchimp Subscribe Craft
Simple Craft plugin for subscribing to a MailChimp list.
Stars: ✭ 117 (-27.33%)
Mutual labels:  craftcms
Linkit
Multi-purpose link plugin for Craft CMS
Stars: ✭ 155 (-3.73%)
Mutual labels:  craftcms
Craft Cli
Command line interface for Craft CMS 2.
Stars: ✭ 143 (-11.18%)
Mutual labels:  craftcms
Craft Fieldlabels
Override Craft CMS field labels and instructions in the field layout designer
Stars: ✭ 128 (-20.5%)
Mutual labels:  craftcms

Craft Master

Craft Master is a starter project for Craft CMS.

Setup

To create a new project:

composer create-project barrelstrength/craft-master <path>

Follow the Craft CMS docs Installation Instructions as appropriate.


To get setup with a Craft CMS project using Craft Master:

  1. Clone the repository to your local environment
  2. Copy .env.example => .env and add your ENVIRONMENT and database connection info
  3. Copy config/local/general.example.php => config/local/general.php and update as desired

Context

Craft provides a framework for configuring a project across multiple environments using environment variables (at the infrastructure level) and multi-environment configs (within the application). Craft Master is designed to work out of the box with the recommended Craft configuration and add flexibility to support a broader range of application configurations.

Craft Master updates the default Craft starter project in the following ways:

  • Adds .editorconfig
  • Updates .gitignore
    • Includes vendor folder
    • Excludes several common editor configurations and misc files
    • Excludes additional items used in development and build scripts
    • Excludes the Craft storage folder (excluding storage/rebrand)
    • Excludes local configuration files
  • Updates default environment conventions to assume three environments: local, dev, production
    • Updates .env to use local as the default ENVIRONMENT variable
  • Enhances support for application-level configuration
    • Updates web/index.php to include .multienv.php and dynamically set the ENVIRONMENT and SITE_URL variables
    • Updates .env settings in config/db.php to use multi-environment config and fallback to default settings if being used with application level configuration
  • Updates config/general.php to:
    • Sets env, baseCpUrl, siteUrl, and @web alias dynamically
    • Updates defaultSearchTermOptions to allow fuzzy searches
    • Sets tokenParam to use t
    • Updates securityKey to support both .env or fallback to a value defined in config/general.php
    • Sets userSessionDuration, rememberedUserSessionDuration, and rememberUsernameDuration to one month
    • Updates config/general.php to support a local override file config/local/general.php that can be excluded from the repo
    • Adds default config/local/general.php with extended login times and several development considerations
  • Updated default Redactor Configs
    • Simple - Bold-Italic.json
    • Content - No Headings.json
    • Content - H2-H3.json
  • Adds a front-end login form for users when a site is offline via templates/503.twig
  • Adds CraftTwigAutoCompleteExtension.php

Considerations

Tracking changes in the repository

Craft Master prefers to keep all project files in the repository and includes the vendor folder to track and deploy changes.

Dynamic environment variables

Craft Master updates web/index.php to include config/multienv.php which adds support for defining the ENVIRONMENT and SITE_URL variables as part of the web request. The ENVIRONMENT and SITE_URL variables are used in the config/general.php file to help define several other settings.

Site URL and @web

The Site URL setting is used in several places and can be defined in the .env file on a per-environment basis.

Alternatively, Craft Master will dynamically set the SITE_URL variable if no Site URL is defined in the .env file. This is done using the $_SERVER['HTTP_HOST'] variable. If you choose this method, be sure your application is using an environment where $_SERVER['HTTP_HOST'] can be trusted. If you are unsure, play it safe and define your Site URL using .env.

Alongside these conventions, Craft Master sets the @web alias dynamically, to help avoid an undesired side effects (such as cache poisoning) if @web is used with its default behavior.

Databases

The default config/db.php has been updated to work in concert with .env so it's easier to use the recommended Craft .env alongside alternative workflows without the need to define some variables multiple times.

For local development, define your database credentials in the .env. In other environments, you can choose to use .env or a multi-environment application configuration.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].