34,79 €
concrete5 is an open source content management system (CMS) for publishing content on the World Wide Web and intranets. concrete5 is designed for ease of use, and for users with limited technical skills. It enables users to edit site content directly from the page. It provides version management for every page and allows users to edit images through an embedded editor on the page.
concrete5 Beginner's Guide shows you everything you need to get your own site up and running in no time. You will then learn how to change the look of it before you find out all you need to add custom functionality to concrete5.
concrete5 Beginner's Guide starts with installation, then you customize the look and feel and continue to add your own functionality. After you've installed and configured your own concrete5 site, we'll have a closer look at themes and integrate a simple layout into concrete5. Afterwards, we're going to build a block from scratch which you can use to manage a news section. We're also going to add a button to our site which can be used to create a PDF document on the fly. This book also covers some examples that show you how to integrate an existing jQuery plugin.
concrete5 Beginner's Guide is a book for developers looking to get started with concrete5 in order to create great websites and applications.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 359
Veröffentlichungsjahr: 2013
Copyright © 2013 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: March 2011
Second Edition: April 2013
Production Reference: 1160413
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78216-931-4
www.packtpub.com
Cover Image by Jarek Blaminsky (<[email protected]>)
Author
Remo Laubacher
Reviewers
Ryan Hewitt
Šarūnas Narkevičius
Werner Nindl
John Steele
Acquisition Editor
Mary Nadar
Lead Technical Editor
Savio Jose
Technical Editors
Sharvari Baet
Ankita Meshram
Kirti Pujari
Project Coordinator
Abhishek Kori
Proofreaders
Maria Gould
Aaron Nash
Stephen Copestake
Indexer
Tejal Soni
Graphics
Sheetal Aute
Production Coordinator
Conidon Miranda
Cover Work
Conidon Miranda
Remo Laubacher grew up in Central Switzerland in a small village surrounded by mountains and natural beauty. He started working with computers a long time ago and then, after various computer-related projects, focused on ERP and Oracle development. After completing his BSc in Business Administration, Remo became a partner at Ortic, his ERP and Oracle business, as well as a partner at Mesch web consulting and design GmbH. At Mesch—where he's responsible for all development-related topics—he discovered concrete5 as the perfect tool for their web-related projects and has since become a key member of the concrete5 community. You can find his latest publications on http://www.codeblog.ch/.
He has also authored concrete5 Beginner's Guide and Creating concrete5 Themes.
Ryan Hewitt has been a web developer for over 10 years and has worked extensively with concrete5, with it being his content management system of choice.
Ryan's background includes working for both large and small development companies, wading through oceans of code and fighting SQL beasts, PHP devils, and CSS nasties. He has written numerous custom online systems and scripts—finding solace in the advantages that well written frameworks and libraries such as CakePHP, jQuery, Boostrap Twitter, and concrete5 bring forth.
Ryan started his own web development business in 2011, with his partner Lelita Baldock, called Mesuva Web Development. From the beautiful coastal town of Goolwa, in South Australia, Ryan and Lelita build a wide range of websites and online shops using concrete5, often heavily customizing them with custom-built blocks and packages.
One of concrete5's greatest strengths as a CMS is its active online community, and Ryan takes pride in contributing answers and insights to the online forum, as well as providing free concrete5 packages and support.
The Mesuva website can be found at https://www.mesuva.com.au and Ryan can be contacted through it.
Werner Nindl is an Oracle Hyperion consultant by day and a concrete5 web developer by night. As a consultant, he has lived and worked in Europe, China, and the US. During his day job, Werner manages consulting programs for Financial Consolidation and Reporting.
Intrigued by the capabilities of concrete5, he has started to convert his clients' web sites to concrete5. Participating in the review of this book has helped him to plan for future enhancements. He believes that he can implement those enhancements now at a much lower resource cost then previously planned.
I want to thank the publishers for the opportunity to participate. First and foremost I want to compliment Remo on his tremendous insight into, and knowledge about, concrete5.
John Steele began teaching himself BASIC on a borrowed Atari. He purchased his first computer, the Timex Sinclair 1000, later trading it in on a Commodore 64. He then taught himself 6502 Assembly followed by the C language, creating a 3D wireframe program to design a hang-glider.
He was a Mathematics major, switching to Computer Science as soon as the degree program was available. He worked as a Systems Programmer at the IBM Almaden Research Center using C, Fortran, Pascal, and 8086 Assembly. Next, he worked as Systems Analyst and Lead Programmer for the largest selling POS software for video stores. He was a beta tester for every version of the Microsoft C compiler.
Fascinated by the Internet, he taught himself PHP3 and MySQL programming and started his business Steelesoft Consulting. He's used just about every Unix-based operating system since the DEC PDP-11 and owns the first version of Linux on CD.
He's also been a technical editor for two PHP4 books by Osborne-McGraw Hill.
I'd like to thank Remo and all the fine folks at concrete5.org and the wonderful people who help others on the Forums everyday.
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 <[email protected]> for more details.
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.
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.
concrete5 Beginner's Guide covers everything you need to build your own website with a number of customizations and add-ons built from scratch, for those who need a pretty site that also offers some slick functionality.
concrete5 is one of many CMS' out there, but it manags to shine with a number of ideas and impressive solutions. For example, there's a very intuitive in-site editing concept where you can manage the content of your site in the actual layout of it and don't have to understand a complicated backend. The book gives you a quick introduction about this concept, but is focused on developers with the intention to build websites and-applications.
You'll therefore need some experience as a web developer, if possible with the technologies used by concrete5: PHP, MySQL, and jQuery. Experience with concrete5 isn't necessary though. The book guides you step-by-step from installation to the customization, and even to the creation of add-ons.
As you'll see towards the end, the packaging system of concrete5 you use to build your add-ons is very powerful and, thanks to the marketplace, you can easily popularize your own work and, if you want, also get some money by selling your add-ons.
Chapter 1, Installing concrete5, helps you to get a test-site running on your local computer, from where we'll continue to work with concrete5.
Chapter 2, Working with concrete5, discusses the basics of concrete5 you need to know to manage the content of a site, basically a compression of an end-user manual.
Chapter 3, Managing Permissions, looks at the powerful permissions of concrete5. You'll learn how to restrict access to a part of your site as well as allowing editors to see parts of the managing interface of concrete5.
Chapter 4, Managing Add-ons, explains what an add-on is and how you can install them from the marketplace.
Chapter 5, Creating Your Own Theme, shows how to convert an existing HTML layout into a concrete5 theme.
Chapter 6, Customizing Block Layouts, looks at ways to customize block layouts—blocks are layout elements in concrete5—making them look well in your own theme.
Chapter 7, Adding Site Navigation, teaches you how to add a dynamic navigation to your website.
Chapter 8, Creating Your Own Add-on Block, teaches you to create your own block, and the content elements of concrete5 from scratch.
Chapter 9, Everything in a Package, discusses how packages make it easier to work with add-ons that contains different things. We'll wrap a few things we've created in the previous chapters into a package.
Chapter 10, Dashboard Extensions, teaches you how to extend the dashboard, which is the place in concrete5 where you manage users, settings, and a lot more.
Chapter 11, Deployment and Configuration, explains how to copy the site from the local computer to a live server and also explains a few configurations.
You're almost free to use any kind of tool you want. The screenshots in this book were taken on a Windows computer but Mac OSX as well as Linux works fine as well. A text editor such as Notepad++, a web server such as Apache with PHP and MySQL, and an FTP client such as FileZilla are all you need.
This book is aimed at developers, knowing the basic web technologies such as HTML, CSS, JavaScript, and PHP required to master the content of this book. Experience with concrete5 isn't necessary but it's helpful to have some experience with PHP and possibly other PHP CMS.
In this book, you will find several headings appearing frequently.
To give clear instructions of how to complete a procedure or task, we use:
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 <[email protected]>, and mention the book title through the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the erratasubmissionform link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
In this chapter, you'll learn what you need to get your own concrete5 site up and running on your local computer. You don't need to have a lot of experience with Apache, PHP, and MySQL configuration as we're going to use Bitnami, which will install all necessary components in almost no time.
Before you can start working with concrete5, you have to set up an environment, where you can test and play around with concrete5 to get used to it. If you have a web hosting account, you can install concrete5 there, but since that isn't always the case, we'll install everything concrete5 needs to work smoothly on your local Windows computer. We're assuming that you're working with Windows but instructions are available for those running Mac OS or Linux; most instructions work the same for all operating systems.
Bitnami installs a local web server, which we'll use to build and test the add-ons we're going to create. In the last chapter of this book, we're going to move the site from your local computer to a live web server.
There are a few tools you need, before you can start with the installation process. You probably already work with similar tools, but let's still make sure you've got everything before continuing.
concrete5 supports all major browsers as long as you're working with an up-to-date version. Please note: you can create a website which is viewable with an outdated browser, but the in-context editing system won't work correctly, unless you're using a modern browser.
Whether you use Firefox, Chrome, Safari, or Internet Explorer doesn't really matter. concrete5 works with any recent browser with JavaScript capability, but it's recommended to use the latest browser version since most concrete5 community members test new releases with the newest browsers.
Since we're going to edit PHP files you'll need a text editor. The requirements are quite small; you can pick almost any text editor you want. Just make sure it does support PHP syntax highlighting. Here are some possible editors:
There are a lot more text editors, as mentioned previously; you can use almost any editor you want. If you're familiar with another product, just go with it. You won't find anything in this book where you need a special text editor feature.
The same with the file archive utility, there are plenty of tools out there and if you want, you can use the in-built extraction utility of Windows or Mac OS. If you're looking for something more advanced, you can go with 7-Zip at http://www.7-zip.org/ orIZArc at http://www.izarc.org/; both are free and do a good job.
Once more, there are lots of choices. You'll have to change file permissions later, so make sure your FTP client includes this option. A powerful and well known client is FileZilla, http://filezilla-project.org/. It's free as well and has a lot more features than we need.
If you think you've found all the tools you'd like to use to create your website, you're ready to install Bitnami. Bitnami is a WAMP stack which provides a lot of different tools needed to run your favorite open source web application on your computer. WAMP is the short form for: Windows, Apache, MySQL, and PHP. The more common term is LAMP and describes the same, but for Linux. It's basically a combination of different applications.
There's a stack for concrete5 that installs everything including concrete5 in no time, but since we want to have a look at the process of installing concrete5 as well, we're going to use the WAMP stack. If you're working with Mac OS or Linux, check Bitnami MAMP, or LAMP; the process is pretty much the same for all the operating systems.
Your local web server is running, there's nothing else to prepare, and you are now ready to install concrete5. There are just a few more steps till you can log in to concrete5.
Before we can install anything we have to get the latest concrete5 version from this URL: http://www.concrete5.org/developers/downloads/. After downloading the zip archive for concrete5, follow these steps:
At the time of writing, concrete5 5.6.1 was the latest version. You can download a newer version if available; changes in the installation process should be minor if there are any at all.
You've downloaded and extracted the concrete5 CMS files. Depending on your archive utility it might have happened that empty folders like updates, files, and others haven't been created. Make sure your structure looks like the one shown in the preceding screenshot.
Before we continue, a few words about the file structure you've just created. It's important that you understand the structure of concrete5 before you start working with it. It's helpful to have a clear understanding about the structure so you can find your files easily. You'll later see that all add-ons in the marketplace follow this structure. Using the suggested structure helps to keep the structure clean, no matter who builds the concrete5 site or add-on.
It might look a bit bulky to have so many folders in the root of your website, but you'll realize that it makes perfect sense to have this structure the more you work with concrete5. We'll have a closer look at some of the directories later in this chapter.
You must create an empty SQL database before you can install concrete5.
Use phpMyAdmin, which is included in the Bitnami stack, to create the database:
All the components
