SilverStripe 2.4 Module Extension, Themes, and Widgets: Beginner's Guide
()
About this ebook
Related to SilverStripe 2.4 Module Extension, Themes, and Widgets
Related ebooks
CMS Made Simple 1.6 Beginner's Guide Rating: 5 out of 5 stars5/5Elgg 1.8 Social Networking Rating: 0 out of 5 stars0 ratingsWordPress 3.7 Complete Rating: 5 out of 5 stars5/5HTML5 and CSS3: Building Responsive Websites Rating: 0 out of 5 stars0 ratingsMastering Django: Core Rating: 0 out of 5 stars0 ratingsDrupal 7 Social Networking Rating: 0 out of 5 stars0 ratingsWordPress Web Application Development Rating: 5 out of 5 stars5/5Node.js 6.x Blueprints Rating: 0 out of 5 stars0 ratingsconcrete5 Beginner's Guide Rating: 0 out of 5 stars0 ratingsWordPress 2.8 Theme Design Rating: 0 out of 5 stars0 ratingsWordPress Plugin Development: Beginner's Guide Rating: 0 out of 5 stars0 ratingsJoomla! 3 Beginner's Guide Second Edition Rating: 0 out of 5 stars0 ratingsconcrete5 Beginner's Guide - Second Edition Rating: 0 out of 5 stars0 ratingsLiferay Portal Systems Development Rating: 0 out of 5 stars0 ratingsPrestaShop 1.5 Beginners Guide Rating: 0 out of 5 stars0 ratingsAlfresco Developer Guide Rating: 0 out of 5 stars0 ratingsOracle Business Intelligence Enterprise Edition 12c - Second Edition Rating: 0 out of 5 stars0 ratingsResponsive Web Design by Example : Beginner's Guide - Second Edition Rating: 0 out of 5 stars0 ratingsBuilding Websites with Microsoft Content Management Server Rating: 3 out of 5 stars3/5WordPress Web Application Development - Second Edition Rating: 0 out of 5 stars0 ratingsDrupal 8 Theming with Twig Rating: 4 out of 5 stars4/5Oracle ADF Enterprise Application Development – Made Simple : Second Edition Rating: 0 out of 5 stars0 ratingsSpring MVC Blueprints Rating: 0 out of 5 stars0 ratingsMastering Magento Theme Design Rating: 0 out of 5 stars0 ratingsMeteor: Full-Stack Web Application Development Rating: 0 out of 5 stars0 ratingsBuilding Websites with PHP-Nuke Rating: 0 out of 5 stars0 ratingsASP.NET 3.5 Social Networking Rating: 0 out of 5 stars0 ratingsSalesforce.com Customization Handbook Rating: 3 out of 5 stars3/5Alfresco 3 Enterprise Content Management Implementation Rating: 3 out of 5 stars3/5
Information Technology For You
Summary of Super-Intelligence From Nick Bostrom Rating: 5 out of 5 stars5/5How to Write Effective Emails at Work Rating: 4 out of 5 stars4/5Computer Science: A Concise Introduction Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Supercommunicator: Explaining the Complicated So Anyone Can Understand Rating: 3 out of 5 stars3/5CompTIA A+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Core 1 Exam 220-1101 Rating: 0 out of 5 stars0 ratingsCompTIA Network+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008 Rating: 0 out of 5 stars0 ratingsPanda3d 1.7 Game Developer's Cookbook Rating: 0 out of 5 stars0 ratingsLinux Command Line and Shell Scripting Bible Rating: 3 out of 5 stars3/5ChatGPT: The Future of Intelligent Conversation Rating: 4 out of 5 stars4/5How To Use Chatgpt: Using Chatgpt To Make Money Online Has Never Been This Simple Rating: 0 out of 5 stars0 ratingsAn Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Data Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5Practical Ethical Hacking from Scratch Rating: 5 out of 5 stars5/5Hacking Essentials - The Beginner's Guide To Ethical Hacking And Penetration Testing Rating: 3 out of 5 stars3/5Windows Registry Forensics: Advanced Digital Forensic Analysis of the Windows Registry Rating: 4 out of 5 stars4/5Health Informatics: Practical Guide Rating: 0 out of 5 stars0 ratingsThe Basics of Hacking and Penetration Testing: Ethical Hacking and Penetration Testing Made Easy Rating: 4 out of 5 stars4/5Computer Organization and Design: The Hardware / Software Interface Rating: 4 out of 5 stars4/520 Windows Tools Every SysAdmin Should Know Rating: 5 out of 5 stars5/5Quantum Computing for Programmers and Investors: with full implementation of algorithms in C Rating: 5 out of 5 stars5/5A Mind at Play: How Claude Shannon Invented the Information Age Rating: 4 out of 5 stars4/5The Programmer's Brain: What every programmer needs to know about cognition Rating: 5 out of 5 stars5/5Cybersecurity for Beginners : Learn the Fundamentals of Cybersecurity in an Easy, Step-by-Step Guide: 1 Rating: 0 out of 5 stars0 ratingsCompTIA ITF+ CertMike: Prepare. Practice. Pass the Test! Get Certified!: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsThe Ultimate Guide to Landing a Network Engineering Job Rating: 0 out of 5 stars0 ratingsInkscape Beginner’s Guide Rating: 5 out of 5 stars5/5
Reviews for SilverStripe 2.4 Module Extension, Themes, and Widgets
0 ratings0 reviews
Book preview
SilverStripe 2.4 Module Extension, Themes, and Widgets - Philipp Krenn
Table of Contents
SilverStripe 2.4 Module Extension, Themes, and Widgets
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code for this book
Errata
Piracy
Questions
1. Principles and Concepts
Why SilverStripe
CMS and framework
Openness and interoperability
Getting your job done
The file structure
assets/
cms/
googlesitemaps/
mysite/
sapphire/
themes/
SilverStripe's ecosystem
The company behind SilverStripe
Documentation
User help
Developer documentation wiki
API documentation
Community
Forum
IRC chat
Development mailing list
Bug tracker
Summary
2. Customizing the Layout
Templates and themes
Switching between themes
Time for action—change the default theme
What just happened?
Getting more themes
Template engine
Another template engine?
Taking a look at BlackCandy
CSS
editor.css
layout.css, form.css, and typography.css
ie6.css
Templates
Learning the very basics
Starting to use templates
Time for action—using site title and slogan
What just happened?
Layout
Includes
Have a go hero—using page name, navigation label, and metadata title
Page control overview
More placeholders
Pop quiz—placeholders
Casting placeholders
Security
Date formatting
Have a go hero—add the time of the creation and when it was edited
Users
Control structures
Handle with care
Embedding and linking files
Comments and base tag
Conditional statements
Control statements
BlackCandy revisited
Creating our own theme
Time for action—files and folders for a new theme
Basic layout
File themes/bar/templates/Page.ss
Time for action—the base page
What just happened?
File themes/bar/templates/Layout/Page.ss
Time for action—the layout page
What just happened?
The includes: BasicInfo.ss, Menu.ss, and Footer.ss
Time for action—the includes
Have a go hero—create the layout and pages
What's next?
Not finding the #*?~^ error?
Adding interactive features
Time for action—let users share our page on Facebook and Twitter
What just happened?
Taking care of search engines
Semantic HTML
Meaningful URLs
Broken links
Duplicate content
Meta tags
Validation
Sitemap
Pop quiz—say hello to the current user
Summary
3. Getting Control
of Your System
Model View Controller (MVC)
Why the big fuss?
View: Presenting your content
Model: Managing your data
Controller: Providing your logic
Taking a look at an example
Structure of a Page
Page.php: Your initial start
Convention over configuration revisited
Extending classes is key
Coding conventions
Have a go hero—creating our own page
Using the Controller
Path constants
The default page class
Setting up CSS
Including CSS files
Time for action—adding a print style
What just happened?
Combining CSS files
Time for action—reducing HTTP requests for CSS files
What just happened?
Adding custom CSS
Pop quiz—duplication or not?
Taking care of Internet Explorer
Time for action—add your own head tags
What just happened?
Setting up JavaScript
Including Google Analytics
Time for action—adding custom JavaScript in the Controller
What just happened?
Blocking files
Time for action—removing JavaScript in the Controller
What just happened?
Where to include CSS and JavaScript
Coding conventions
Coding
Indentation
Curly braces
Check before looping
Keeping the Controller clean
Comments
Methods
Static methods
Action handler methods
Template methods
Object methods
Variables
Element order
Spam protecting e-mail addresses
Controller
Template
CMS
URL variables and parameters
Activating changes
Debugging
Template
Controller
Request
Debug
Performance
Debugging the code
Adding an Intro page
Time for action—add an Intro page
What just happened?
Pop quiz—basic principles
Summary
4. Storing and Retrieving Information
DBPlumber
Your new best friend: DBPlumber
Time for action—installing DBPlumber
What just happened?
From a database's point of view
Adding custom fields to a page
Time for action—putting content into the database
What just happened?
More data types and their form fields
Have a go hero—transfer the other BasicInfo.ss elements to the CMS
Global custom fields
Configuration
Code
Database fields
Accessing properties in the CMS
Template
Synchronize the database and you're ready to go
How database values are fetched
Pushing
Pulling
Taking the Model further
Removing unused Page types
Showing the Page type in the Page Tree
Adding an image
Don't change the file ending
Using constants
More SiteTree magic
Cleaning up content fields
Setting a meta title prefix
Managing relations
Time for action—linking pages together
What just happened?
Definition
Adding relationships to the CMS
Using it in the template
Complex relationships
Queries
Security
Casting
Escaping
Debugging queries
Visible or invisible?
In the Model
In the Controller
Summary
5. Customizing Your Installation
Configuration in general
Default settings
Environment
dev
test
live
Defining a development server
Server-wide configurations
Logging
Logging information
Error levels
SilverStripe and PHP errors
Website errors
Notification of errors
Securing the logs
Templates
Security
Customizing the CMS
Removing tabs
Rebranding the CMS
Loading add-ons
WYSIWYG
Switching to HTML
Removing buttons
Adding buttons
Configuring plugins
Options
Comments and spam
Math questions
Akismet
Other measures
Miscellaneous settings
Accessing and advertising content
Allowing file extensions
Customizing Breadcrumbs
Image quality
JavaScript validators
Defines
Time for action—building our own configuration
Managing your code
Version control system
VCS basics
Using Git in your project
Manual upgrade of core files
Automatic upgrade of core files
Contributing back
Pop quiz—environment types
Summary
6. Adding Some Spice with Widgets and Short Codes
Widget or short code?
Creating our own widget
Time for action—embracing Facebook
What just happened?
Widgets in general
Facebook graph API
Connecting pages and widgets
$SideBar
What about the intro page?
Facebook feed widget
Facebook output
The logic in general
Taking a look at the details
Error handling
DBField::create
DataObjectSet
The template
The other template
More widgets
Have a go hero—Twitter
Text parser
Time for action—doing it right
What just happened?
Caching
Partial caching
Static publisher
Static exporter
Restful service
Partial caching
Example
Time for action—caching
What just happened?
Configuration
Controller
Template
General considerations
More on partial caching
Carefully test your cache settings
Cache directory
Performance gains
Server-side
Client-side
Creating our own short code
Time for action—how to find us
What just happened?
What do we want to achieve?
Configuration
Model
General composition
Example-specific code
Template
Common pitfalls
Go forth and build your own
Pop quiz—too many options?
Summary
7. Advancing Further with Inheritance and Modules
Enhancing the intro page
Time for action—adding the required modules
What just happened?
Time for action—extending the backend functionality
What just happened?
Introducing the DataObject class
SiteTree
DataObject
DataObjectDecorator
Making DataObjects sortable
Adding our DataObject to the intro page
Storing required information in the database
Providing a field in the CMS
Time for action—integrating our changes into the frontend
What just happened?
Working with images
Image functions
Images in the Controller
Images in the View
Pop quiz—SiteTree, DataObject, or DataObjectDecorator
Image galleries
Time for action—creating our own image gallery in the CMS
What just happened?
A single gallery image
Image gallery container
Time for action—our image gallery in the frontend
What just happened?
Image gallery template
Transforming our code into a module
Creating a module
Required changes
Time for action—adapting the module
What just happened?
Time for action—integrating the module into our page
What just happened?
Contribute back to the community
Summary
8. Introducing Forms
Building a contact form
Time for action—creating a basic contact form
The backend
Including our form in the frontend
Creating an e-mail template
What just happened?
The frontend
The e-mail template
The Model
The Controller
Setting up the form
Processing the input
Sending the e-mail
Handling the success page
Convention of method names
Renting a table
Going abstract
Time for action—extending our form with abstraction
The backend
Changes in the template file
Update the e-mail template
What just happened?
Abstract
Model
Controller
Implementation
Adding client-side validation
Default client-side validation
Enhanced client-side validation
Time for action—using jQuery's Validation plugin on the contact page
What just happened?
jQuery's Validation plugin
Time for action—using jQuery's Validation plugin on the rent page
What just happened?
Setting up the Datepicker
Should you add JavaScript to the Controller?
Tougher server-side validation
Time for action—better server-side validation
What just happened?
Have a go hero—order a member card
Pop quiz—true or false
Summary
9. Taking Forms a Step Further
Searching our pages
Time for action—adding search functionality to our page
What just happened?
The Controller part of the code
The View part of the code
Customizing forms even further
Overwriting the global template
Handcrafting forms with SilverStripe
Saving data to the database
Time for action—extending the member card form
What just happened?
The Model part of the code
Setting up the fields
New arguments for TextField
OptionsetField
CheckboxField
DateField options
Checking for invalid data and duplicate e-mail addresses
Saving a new entry to the database
Field types overview
ConfirmedPasswordField
HiddenField
More
Checking the e-mail address for uniqueness
Time for action—checking the e-mail's uniqueness with Ajax
What just happened?
Doing more with sessions
Time for action—using the session in forms
What just happened?
How to store members in the database
Pop quiz—advanced forms
Summary
10. Targeting the Whole World
Globalization in general
Globalization in the CMS
Time for action—configuring the CMS for globalization
What just happened?
Globalization in the code
Have a go hero
Localizing and internationalizing the templates
Starting our globalization efforts
Time for action—globalizing the intro page
What just happened?
Generating locale files
Localizing and internationalizing the PHP code
Time for action—translating the rent form
What just happened?
Localizing and internationalizing JavaScript
Time for action—translating the rent form's JavaScript
What just happened?
Have a go hero
Getting the right content
Time for action—switching the locale
What just happened?
Pop quiz—if or when should you globalize
Where to go from here
More modules
Adding more ideas and features to your page
Summary
A. Pop Quiz Answers
Chapter 2, Customizing the Layout
Pop quiz—placeholders
Pop quiz—say hello to the current user
Chapter 3, Getting Control
of Your System
Pop quiz—duplication or not?
Pop quiz—basic principles
Chapter 5, Customizing Your Installation
Pop quiz—environment types
Chapter 6, Adding Some Spice with Widgets and Short Codes
Pop quiz—too many options?
Chapter 7, Advancing Further with Inheritance and Modules
Pop quiz—SiteTree, DataObject, or DataObjectDecorator
Chapter 8, Introducing Forms
Pop quiz—true or false
Chapter 9, Taking Forms a Step Further
Pop quiz—advanced forms
Chapter 10, Targeting the Whole World
Pop quiz—if / when should you globalize
Index
SilverStripe 2.4 Module Extension, Themes, and Widgets
Beginner's Guide
SilverStripe 2.4 Module Extension, Themes, and Widgets
Beginner's Guide
Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2011
Production Reference: 1260411
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-849515-00-9
www.packtpub.com
Cover Image by Filippo (<Filosarti@tiscali.it>)
Credits
Author
Philipp Krenn
Reviewers
Aaron Carlino
Ingo Schommer
Sigurd Magnusson
Acquisition Editor
Tarun Singh
Development Editor
Meeta Rajani
Technical Editors
Aaron Rosario
Hithesh Uchil
Project Coordinator
Michelle Quadros
Proofreader
Dan McMahon
Indexer
Tejal Daruwale
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
About the Author
Philipp Krenn studies software engineering at the University of Technology, Vienna. At the moment, he is writing his thesis on current database trends. Besides that, he's working as a freelance IT trainer and web developer, mostly using SilverStripe, but also Drupal, CakePHP, and Smarty.
He started using SilverStripe in 2007 as one of the Google Summer of Code students improving the project, beginning with the effort to support multiple databases (besides MySQL). During this, he got a detailed insight into the inner workings of the project. Since then he's been in love with SilverStripe...
Philipp is currently employed at the University of Technology, Vienna as diplomate for an industry project and as IT training manager at Splendit IT Consulting GmbH. When doing freelance work he's frequently working for men on the moon GmbH, on SilverStripe projects, or as IT trainer for SPC GmbH.
Even when working on something inspiring, writing a book is actually hard work — lo and behold ;-).
Therefore a huge THANK YOU to the people making it possible!
Packt Publishing for channeling my enthusiasm into something useful, while helping wherever they could. Danke
to Michelle Quadros for making our schedule work out, and also Tarun Singh, Meeta Rajani, Hithesh Uchil, and Aaron Rosario for keeping me on the right track.
Ingo Schommer from SilverStripe Ltd. lent more than one helping hand in the creation of this book. Additionally he and my other two reviewers Sigurd Magnusson (SilverStripe Ltd.) and Aaron Carlino (Bluehouse Group) provided crucial input — without you the book would only be half as good.
Last but not least my girl, family, and friends, who lost me for months to writing this book. Without you providing the right background this would have been impossible!
About the Reviewers
Aaron Carlino is a web developer who is better known in the SilverStripe community by his whimsical pseudonym Uncle Cheese
. He has been doing web development since 2005, and has found his niche in SilverStripe programming after an exhaustive search for a content management solution that was welcoming to developers and would stay out of his way. Since then, he has established a strong reputation in the SilverStripe community as a mentor, support provider, and, most notably, a contributor of some of the application's most popular modules including DataObjectManager, ImageGallery, and Uploadify.
During the day, he is employed full-time at Bluehouse Group as lead SilverStripe developer, surrounded by a team of talented designers, programmers, and HTML developers. At Bluehouse Group, he has worked on several sophisticated web applications built on SilverStripe, including All Earth Renewables, ISI, and Yestermorrow. In his spare time, he keeps his SilverStripe thirst quenched by entertaining a variety of freelance projects which range from ad-hoc support work for his modules to full-featured web applications, including Xetic.org. In addition, he has almost always worked on new open-source contributions to the SilverStripe CMS, because, quite frankly, he can't get enough of it.
When he is not coding, he usually thinks about what he'd like to code, and when he's not doing that, he enjoys cooking (and subsequently photographing) all kinds of delicious foods. He is also a talented guitar player and French speaker, as well as a connoisseur of all things Elvis Costello. He lives a blessed and charmed life in beautiful northwestern Vermont with his wife and shih-tzu, Oscar.
Ingo Schommer is a senior developer at SilverStripe Ltd. in Wellington, New Zealand. He is responsible for large scale web application development. Not entirely by chance, he is also a core team member and release manager for the SilverStripe project. Originally hailing from Germany, he was co-author of the first SilverStripe book in his native tongue, quickly followed by an English translation. He's always keen to spread the word about his favorite CMS, and hence thrilled to see a Packt publication on this topic.
Sigurd Magnusson is one of the three co-founders of SilverStripe Ltd (http://silverstripe.com/). He has been in this business for more than ten years and currently focuses on sales and marketing. He's been living and breathing the Internet since 1995, when his city council provided the only local internet service, entirely text-based at the time. The potential of the Internet piqued his interest and he began learning computer programming.
While his days at SilverStripe are no longer spent propgramming, he continues to be deeply interested in the technology advances of the Web. Sigurd is an evangelist for the principles and technology of the Web, and is an avid supporter of open source, open data, and the Web as a modern software platform.
He is very familiar with both the commercial and open source segments of the web content management industry, and he influences the direction of the open source SilverStripe CMS and Sapphire framework.
Off the Web, he enjoys spending time with his family, cross-country mountain biking in New Zealand, and experiencing foreign cultures.
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
Fully searchable across every book published by Packt
Copy and paste, print and bookmark content
On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Preface
SilverStripe CMS is an open source web content management system used by governments, businesses, and non-profit organizations around the world. It is a powerful tool for professional web development teams, and web content authors rave about how easy it is to use.
This book is a beginner-friendly introduction to SilverStripe and the only printed documentation for the current 2.4 release. While it starts off nice and easy, we progress fast, covering both SilverStripe's intuitive CMS and powerful framework. We'll show you how to easily extend the core system with your own themes, widgets, and modules by gradually building and extending a graphic example. This unique book helps both frontend designers and backend programmers to make the most of SilverStripe.
What this book covers
Chapter 1, Principles and Concepts introduces the software's distinct features, namely being both a framework and a CMS. Additionally, the general approach and structure are described, as well as the ecosystem supporting both developers and users.
Chapter 2, Customizing the Layout takes an in-depth look at SilverStripe's template engine. It explains how to build and customize your own layout. The code created here will be extended over the later chapters, providing a simple but already useful introduction. Finally, the chapter teaches how to optimize your search engine ranking with the help of the CMS.
Chapter 3, Getting Control
of Your System explains the underlying architecture of the framework: Model View Controller (MVC). Building on the View role from the previous chapter, this one covers the Controller. Specifically how to create your own page types.
Chapter 4, Storing and Retrieving Information explores the Model, the third and final MVC role. SilverStripe provides custom database abstraction, allowing developers to focus on object-oriented code only. Building on this knowledge, you'll learn how to add custom data to the example project.
Chapter 5, Customizing Your Installation introduces the most important configuration options. These include settings both for the CMS and the underlying framework, for example configuring the rich-text editor, logging, security, and much more.
Chapter 6, Adding Some Spice with Widgets and Short Codes covers SilverStripe's widget system. Specifically it shows how to automatically fetch data from Facebook and how to integrate it into the example project, allowing content editors simply to drag-and-drop content into different pages.
Chapter 7, Advancing Further with Inheritance and Modules takes a look at (object-oriented) inheritance and how to make the most of it in combination with modules. A very popular module is used and you'll further extend it, teaching you how to modularize and reuse code.
Chapter 8, Introducing Forms makes our site more interactive. It introduces forms and how to easily handle them in SilverStripe. This covers both server and client side validation, how to process inputs and the built-in e-mail capabilities.
Chapter 9, Taking Forms a Step Further broadens the concepts from the previous chapter. It adds a general search functionality and then focuses on storing user provided inputs in the database. Additionally validation concepts are explored further.
Chapter 10, Targeting the Whole World introduces SilverStripe's powerful globalization features. You'll learn how to take advantage of them in the framework and the CMS, removing language barriers while still keeping it simple.
Chapter 11, Creating an Application turns the focus from the public facing website to a fully featured application in the background. Specifically you'll learn how to easily manage data in the CMS and you'll delve deeper into architectural decisions impacting the whole development. This chapter is available along with the code download for this book.
Appendix A, Installing SilverStripe introduces beginners to SilverStripe's installation process. You'll learn how to install SilverStripe itself, as well as how to set up development and live environments for your sites. This chapter is available along with the code download for this book.
Who this book is for
If you are a SilverStripe developer and want to learn the nooks and crannies of developing fully-featured SilverStripe web applications, then this book is for you. Building upon your knowledge of PHP, HTML, and CSS, this book will take you to the next level of SilverStripe development. The book assumes basic experience with SilverStripe.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: To include a JavaScript file, instead of plain HTML, you can use <% require javascript(sapphire/thirdparty/jquery/jquery-packed.js) %>.
A block of code is set as follows:
public static $has_one = array(
'SideBar' => 'WidgetArea',
);
public function getCMSFields(){
$fields = parent::getCMSFields();
$fields->addFieldToTab(
'Root.Content.Widgets',
new WidgetAreaEditor('SideBar')
);
return $fields;
}
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
public static $has_one = array(
'SideBar' => 'WidgetArea',
);
public function getCMSFields(){
$fields = parent::getCMSFields();
$fields->addFieldToTab(
'Root.Content.Widgets',
new WidgetAreaEditor('SideBar')
);
return $fields;
}
Any command-line input or output is written as follows:
pear upgrade --alldeps
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: clicking the Next button moves you to the next screen
.
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book — what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <feedback@packtpub.com>, and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail
If there is a topic that you have expertise in