imarc/padstone

Craft CMS

Installs: 257

Dependents: 0

Suggesters: 0

Security: 0

Stars: 15

Watchers: 9

Forks: 6

Language:JavaScript

Type:project


README

57405127-a7331580-71ab-11e9-8d16-0ee4a9c55328.jpg

Padstone for Craft CMS

Padstone is a starter package for Craft 3 built by Imarc. It provides a simple project config as well as example entries and templates.

If you would like to use the older version of Padstone for Craft 2, see the craft2 branch.

Features

  • Pre-built CMS sections, including ones for the Homepage, a Blog, News, and Resources. (18 in total!)
  • A set of Bootstrap 4 twig templates for you to replace or customize.
  • A matrix-based Content Designer field, built within Craft, for laying out pages beyond simple rich text.
  • A set of (free) plugins selected by Imarc that we recommend for new projects.

56689796-f0fb0680-66a9-11e9-8b4b-e66690ed9607.jpg

Getting Started

Create a new padstone project with the following composer command:

composer create-project imarc/padstone [folder]

Enter the newly created folder and run the front-end buildstep.

cd [folder]

npm install
npm run dev

Create your database and ensure the settings in your .env match your environment. At minimum, you'll need to tell Craft how to connect to your database and your domain. Then run the installer by going to /admin (except for your domain.)

Optionally, you can import the supplied padstone.sql file into your database if you want Padstone's starter entries.

Logging in

If you import padstone.sql, the username is admin and the password is padstone. Please change the password after you first login.

Front-End Build

Beyond the typical craft files, you will also see a resources/ folder. Padstone uses Laravel Mix to compile JS and Sass files from the resources/ folder and store the results into the public/ folder:

  • resources/assets/sass/main.scss is compiled to public/css/main.css
  • resources/assets/js/main.js is compiled to public/js/main.js

Additionally, Padstone produces manifest.js and vendor.js files that must be included, in that order, before any of your own JS files. You can customize this behavior in webpack.mix.js.

Watching/Building assets

While developing, you most likely want to watch the files you are working on, so the build happens automatically after every save.

npm run watch

If you want to run this same build process for dev without watching, you can run the following:

npm run dev

If you are building to production, run:

npm run prod

What's Included

Sections

Padstone includes the following sections:

  • Homepage
  • Blog Page and Blog Articles
  • News & Events Page, News Articles, and Events
  • Resources Page and Resources
  • About Page, Leadership Page, Contact Page, Privacy Page, People
  • Custom Landing Pages
  • Error Page and 404 Page

Plugins

The following plugins are currently included and installed via composer, which is what Craft uses for the Plugin Store as well:

Suggested Additional Plugins

These plugins didn't make the cut for Padstone, but they are plugins we'd recommend people look at if they have specific needs:

  • Element API - easy creation of JSON APIs for your website. Likely to be included in the next version of Padstone. Free.
  • Feed Me - import content into craft from XML, CSV, and other kinds of exports. Currently Pro is $99 and $30/year.
  • Guide - add documentation with Craft. Currently $39 and $19/year.
  • Retour - if the included Redirect Manager plugin isn't powerful enough, Retour provides some additional functionality and reporting beyond what Redirect Manager does. Currently $59 and $29/year.

Macros

There is a _macros.twig file that provides The following macros:

  • renderAllBlocks and renderBlock - these are used to render the designedContent field.
  • pagination - used to generate pagination.
  • commaSeparate - used to generate a comma separated list of elements based on title.

Blocks

The Content Designer Field (designedContent) allows CMS users to use the following blocks out of the box:

  • Rich Text
  • Two Columns
  • Image with Text
  • Video with Text
  • Testimonial
  • HTML Widget/Embed
  • Call to Action
  • Shared Block

License

Padstone is released under the MIT License.

Contributing

Set up a padstone project with the ability to contribute back.

# clone project and enter directory
git clone git@github.com:imarc/padstone.git
cd padstone

# install composer deps
composer install

# create .env
cp .env.example .env

# generate craft security key
php craft setup/security-key

# install boilerplate components
npx imarc/boilerplate-components
echo '@import "~bootstrap/scss/bootstrap";' >> resources/styles/main.scss"
echo 'import "bootstrap";' >> resources/js/main.js"

# import sql into db. If you are using ops, the command is:
ops mariadb padstone padstone.sql

# Manual step:
# set DB_DATABASE in your .env to 'padstone'

Imarc

© 2019 Imarc