
www.allitebooks.com SilverStripe 2.4 Module Extension, Themes, and Widgets Beginner's Guide Create smashing SilverStripe applicaions by extending modules, creaing themes, and adding widgets Philipp Krenn BIRMINGHAM - MUMBAI www.allitebooks.com 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 transmited in any form or by any means, without the prior writen permission of the publisher, except in the case of brief quotaions embedded in criical aricles or reviews. Every efort has been made in the preparaion of this book to ensure the accuracy of the informaion presented. However, the informaion 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 informaion about all of the companies and products menioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this informaion. First published: May 2011 Producion 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 ([email protected]) www.allitebooks.com Credits Author Project Coordinator Philipp Krenn Michelle Quadros Reviewers Proofreader Aaron Carlino Dan McMahon Ingo Schommer Sigurd Magnusson Indexer Tejal Daruwale Acquisiion Editor Tarun Singh Producion Coordinator Aparna Bhagat Development Editor Meeta Rajani Cover Work Aparna Bhagat Technical Editors Aaron Rosario Hithesh Uchil www.allitebooks.com About the Author Philipp Krenn studies sotware engineering at the University of Technology, Vienna. At the moment, he is wriing 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 efort to support muliple 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 Consuling 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, wriing 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 creaion of this book. Addiionally 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 wriing this book. Without you providing the right background this would have been impossible! www.allitebooks.com About the Reviewers Aaron Carlino is a web developer who is beter 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 ater an exhausive search for a content management soluion that was welcoming to developers and would stay out of his way. Since then, he has established a strong reputaion in the SilverStripe community as a mentor, support provider, and, most notably, a contributor of some of the applicaion's most popular modules including DataObjectManager, ImageGallery, and Uploadify. During the day, he is employed full-ime 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 sophisicated web applicaions built on SilverStripe, including All Earth Renewables, ISI, and Yestermorrow. In his spare ime, 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 applicaions, including Xeic.org. In addiion, he has almost always worked on new open-source contribuions 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 beauiful 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 applicaion development. Not enirely 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 irst SilverStripe book in his naive tongue, quickly followed by an English translaion. He's always keen to spread the word about his favorite CMS, and hence thrilled to see a Packt publicaion on this topic. www.allitebooks.com 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 markeing. He's been living and breathing the Internet since 1995, when his city council provided the only local internet service, enirely text-based at the ime. The potenial of the Internet piqued his interest and he began learning computer programming. While his days at SilverStripe are no longer spent propgramming, he coninues 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 sotware plaform. He is very familiar with both the commercial and open source segments of the web content management industry, and he inluences the direcion of the open source SilverStripe CMS and Sapphire framework. Of the Web, he enjoys spending ime with his family, cross-country mountain biking in New Zealand, and experiencing foreign cultures. www.allitebooks.com www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support iles and downloads related to your book. Did you know that Packt ofers eBook versions of every book published, with PDF and ePub iles available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are enitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collecion of free technical aricles, sign up for a range of free newsleters and receive exclusive discounts and ofers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant soluions to your IT quesions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's enire 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 enirely free books. Simply use your login credenials for immediate access. www.allitebooks.com www.allitebooks.com Table of Contents Preface 1 Chapter 1: Principles and Concepts 7 Why SilverStripe 8 CMS and framework 8 Openness and interoperability 9 Geing your job done 9 The ile structure 10 assets/ 10 cms/ 10 googlesitemaps/ 11 mysite/ 11 sapphire/ 11 themes/ 11 SilverStripe's ecosystem 11 The company behind SilverStripe 12 Documentaion 12 User help 13 Developer documentaion wiki 14 API documentaion 14 Community 15 Forum 15 IRC chat 16 Development mailing list 16 Bug tracker 16 Twiter 17 Summary 17 Chapter 2: Customizing the Layout 19 Templates and themes 20 Switching between themes 20 Time for acion – change the default theme 20 Geing more themes 22 www.allitebooks.com Table of Contents Template engine 22 Another template engine? 22 Taking a look at BlackCandy 23 CSS 23 editor.css 23 layout.css, form.css, and typography.css 24 ie6.css 24 Templates 24 Learning the very basics 24 Staring to use templates 25 Time for acion – using site itle and slogan 25 Layout 26 Includes 27 Page control overview 27 More placeholders 28 Casing placeholders 30 Security 30 Date formaing 31 Users 32 Control structures 33 Handle with care 33 Embedding and linking iles 34 Comments and base tag 34 Condiional statements 35 Control statements 36 BlackCandy revisited 38 Creaing our own theme 40 Time for acion – iles and folders for a new theme 40 Basic layout 40
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages368 Page
-
File Size-