Slide 1

Slide 1 text

Philipp Krenn @xeraa https://xeraa.net

Slide 2

Slide 2 text

Background Google Summer of Code Student 2007 Multiple Database Support

Slide 3

Slide 3 text

Background

Slide 4

Slide 4 text

Background GSoC Mentor 2012: Yuki Awano Content Personalization

Slide 5

Slide 5 text

Ecosystem BSD licensed — http://www.silverstripe.org SilverStripe Ltd. — http://www.silverstripe.com

Slide 6

Slide 6 text

Development 2007 2008 2009 2010 2011 2012 2013 2.0 3.1 3.0 2.4 2.3 2.1 2.2 2014 2015 3.2

Slide 7

Slide 7 text

Installation

Slide 8

Slide 8 text

Requirements Apache httpd, nginx, lighttpd, IIS PHP 5.3+ MySQL 5.0+ PostgreSQL 8.3+, SQL Server 2008+, SQLite 3.3+ via modules Chrome, Firefox, IE 8+ (Safari) for the CMS Composer recommended

Slide 9

Slide 9 text

Preparation Empty database silverstripe nginx configuration _silverstripe3: https://gist.github.com/xeraa/9527232 server { root /Users/philipp/Sites/silverstripe; server_name silverstripe.local; include _silverstripe3; } /etc/hosts: 127.0.0.1 http://silverstripe.local

Slide 10

Slide 10 text

Installation $ composer create-project silverstripe/installer
 ~/Sites/silverstripe 3.1.12 http://silverstripe.local $ chmod -R 777 ~/Sites/silverstripe/assets/
 $ chmod 777 ~/Sites/silverstripe/mysite/_config.php

Slide 11

Slide 11 text

CMS

Slide 12

Slide 12 text

Overview http://silverstripe.local/admin/ Pages Reports Files Security Settings

Slide 13

Slide 13 text

First Steps Change the CMS language and date formats Change the site title and slogan

Slide 14

Slide 14 text

Pages Content Settings History Viewing modes Split (screen size dependent) Preview including different devices Edit

Slide 15

Slide 15 text

CSS themes/simple/css/typography.css .typography h1 { … background: #ee5757; } Force reload in the CMS

Slide 16

Slide 16 text

Under the Hood Database tables SiteConfig SiteTree, SiteTree_Live, SiteTree_versions

Slide 17

Slide 17 text

Framework

Slide 18

Slide 18 text

Basics MVC Pulling data, not pushing it Object-oriented — extension via inheritance / mixins Everything is code

Slide 19

Slide 19 text

Template Structure mysite/templates/, mysite/css/,… themes//templates/, themes// css/,… themes/ Includes/ Layout/Page.ss (optionally more) Page.ss

Slide 20

Slide 20 text

Template Elements $Title, $Content, $SiteConfig.Title <% loop $Menu(1).Limit(5) %>
 $Link
 <% end_loop %> <% if not $Children %> … <% end_if %> <% with $CurrentMember %>
 $FirstName
 <% end_with %>

Slide 21

Slide 21 text

Template Changes templates/Includes/Footer.ss Proudly powered by SilverStripe templates/Page.ss <% include Subfooter %> templates/Includes/Subfooter.ss

© Philipp Krenn

Slide 22

Slide 22 text

http://will-rossi.deviantart.com/art/SilverStripe-WallPaper-01-59254232

Slide 23

Slide 23 text

Triggering an Error Delete an <% end_… $> mysite/_config/config.yml: dev, test, live Director:
 environment_type: 'dev'

Slide 24

Slide 24 text

A New Page Type mysite/code/MeetupPage.php — Model and Controller themes/simple/templates/Layout/ MeetupPage.ss — View

Slide 25

Slide 25 text

Model 1/2 class MeetupPage extends Page { private static $db = array( 'Date' => 'Date', 'Type' => 'Enum("Unknown, PHP, Symfony,
 Drupal, SilverStripe", "Unknown")', ); private static $has_one = array( 'Logo' => 'File', );

Slide 26

Slide 26 text

Model 2/2 public function getCMSFields() { $fields = parent::getCMSFields(); $dateField = new DateField('Date'); $dateField->setConfig('showcalendar', true); $fields->addFieldToTab('Root.Main', $dateField, 'Content'); $fields->addFieldToTab('Root.Main',
 new DropdownField('Type', 'Type of event',
 singleton('MeetupPage')->dbObject('Type')->
 enumValues()), 'Content');
 $fields->addFieldToTab('Root.Main', new UploadField('Logo'),
 'Content'); return $fields; }

Slide 27

Slide 27 text

Controller class MeetupPage_Controller extends
 Page_Controller { }

Slide 28

Slide 28 text

Synchronize the Database http://silverstripe.local/dev/build?flush=all Add new page in the CMS

Slide 29

Slide 29 text

View <% include SideBar %>

$Title


 $Type
 <% if $Type == "SilverStripe" %>*yeah*<% end_if %>


$Date

logo
$Content
$Form $PageComments

Slide 30

Slide 30 text

Much More DataObjects and Scaffolding Powerful forms with GridField Object-Relational Mapper RESTful API SOAP API Extensible permission system

Slide 31

Slide 31 text

And a Little Less Smallish community outside of New Zealand and Australia A manageable number of modules Hint: https://github.com/search?q=silverstripe- &type=Repositories Few (good) themes

Slide 32

Slide 32 text

More Information http://www.silverstripe.org https://github.com/silverstripe http://www.meetup.com/SilverStripe-Austria http://vimeo.com/silverstripe

Slide 33

Slide 33 text

Try It https://github.com/xeraa/silverstripe-nginx

Slide 34

Slide 34 text

Thanks Questions? Now @xeraa [email protected]