dev-master
9999999-dev https://github.com/colymba/silverstripe-project-boilerplateSilverStripe Project boilerplate/skeleton with nifty tools, tips and tricks.
BSD Simplified
The Requires
silverstripe project boilerplate project skeleton
SilverStripe Project boilerplate/skeleton with nifty tools, tips and tricks.
A very much opinionated SilverStripe project boilerplate/skeleton with nifty tools, tips and tricks., (*2)
This project replaces the default mysite
and themes
folders that comes with any SilverStipe install. And replaces those with a tightly packed project directory easy to manage and ship., (*3)
Action | Terminal |
---|---|
Init dependencies | npm update |
- | bower update |
Start coding | grunt dev |
Ready to ship | grunt dist |
Once you have SilverStripe up and running, save your important _config.php
settings and get rid of the mysite
folder. Rename the ss-project-boilerplate
folder to something that makes sense for you and update the _config.php
., (*4)
There are comments in most of the files included, so read on to learn more about each specific lines. This module will impose the following project structure:, (*5)
Folder/File | Content |
---|---|
:--------------------------- | :-------------------------------------------------------- |
_config |
YAML config + includes for _config.php
|
_config.php |
Base config + include additional ones |
---------------------------- | --------------------------------------------------------- |
_dist |
Ready to ship optimized project will be generated here |
---------------------------- | --------------------------------------------------------- |
code |
All your code |
code/controllers |
Controllers |
code/models |
Everything DataObjects
|
code/models/admins |
ModelAdmins |
code/models/dataObjects |
DataObjects |
code/models/extensions |
DataExtensions |
code/models/pages |
SiteTree descendants |
code/views |
Everything front-end |
code/views/css |
SCSS |
code/views/fonts |
Fonts |
code/views/img |
Images |
code/views/js |
JS |
code/views/js/vendor |
Non Bower JS libraries |
code/views/templates |
SS templates |
All front-end dependencies (CSS + JS) are managed via Bower, edit the bower.json
to suite your needs then run bower update
. These will automatically be injected later on in the SileverStripe templates (Page.ss
+ js.ss
)., (*6)
We'll be using GruntJS to automate the development and publishing process, so make sure to first have the NodeJS packages dependencies installed by runnning npm update
., (*7)
Once that's done, run grunt dev
and start coding. This will inject Bower JS/CSS/SCSS dependencies for you, create a customized Modernizr and watch and compile your SASS for you., (*8)
Once you are done and ready to publish your project, run grunt dist
and an optimized copy of all your project files will be in the _dist
directory ready to upload. Config will be updated to live, CSS/JS concatenated and minified, and all you templates minified too., (*9)
The grunt dist
task will autiomatically replace references of environment_type: 'dev'
to live
in your config.yml
., (*10)
For PHP files (this applies to all PHP files in your project directory), you can use fenced code blocks to specify code that is to be removed or enabled in the distribution version (see _config.php
for an example):
- use /*::config:dev*/
... /*::config*/
to mark blocks of codes to be removed
- use /*::config:live
... ::config*/
to mark blocks of codes to be enabled, (*11)
Copyright (c) 2013, Thierry Francois (colymba), (*12)
All rights reserved., (*13)
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:, (*14)
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE., (*15)
SilverStripe Project boilerplate/skeleton with nifty tools, tips and tricks.
BSD Simplified
silverstripe project boilerplate project skeleton