Book Image

concrete5 Cookbook

Book Image

concrete5 Cookbook

Overview of this book

concrete5 is an increasingly popular open source content management system because of its incredible and easy-to-use interface. But, it also comes complete with a robust PHP framework, allowing web developers to create custom websites and applications with ease. "concrete5 Cookbook" is a practical collection of solutions to tasks that both novice and experienced concrete5 developers face on a regular basis. Readers will learn multiple subjects, including full blueprints for developing an event calendar add-on and an image gallery block. Developers new to concrete5 will quickly learn how to customize concrete5 to their needs, and seasoned pros will find it an excellent quick reference for performing specific tasks. "concrete5 Cookbook" will transform ordinary PHP developers into concrete5 experts capable of bending concrete5 to their will and unleashing the true power of this up-and-coming content management system. Throughout the course of over 140 recipes and 3 bonus project blueprint chapters, PHP developers will learn how to create custom blocks and dashboard interfaces as well as programmatically work with pages, files, users, permissions, and more. Discover the built-in Active Record support that makes working with databases simple and maintainable. Readers will also learn how to take advantage of the numerous helper classes included in concrete5, and will dive deep into the concrete5 MVC framework to create powerful custom websites and applications. Tie together all of the concepts learned in the recipes with 3 bonus chapters featuring complete blueprints to create a calendar add-on, an image gallery block type, and tips on how to sell your themes and add-ons for money! "concrete5 Cookbook" is a complete collection of recipes to solve the most common (and some not-so-common) tasks that concrete5 developers will face on a regular basis.
Table of Contents (19 chapters)
concrete5 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

concrete5 is an increasingly popular open source content management system. concrete5 sets itself apart from other CMS applications with its easy to use point-and-click interface and multitude of features. Web developers love concrete5 because it is very easy to customize and build additional features in a relatively short time. This book aims to explain a variety of common programming tasks for concrete5 developers in an easy to read recipe format.

What this book covers

Chapter 1, Pages and Page Types, helps us learn how to work with pages and page types using the concrete5 API.

Chapter 2, Working with Blocks, creates custom block types and integrates blocks in your own website.

Chapter 3, Files and File Sets, develops files store in concrete5's excellent file manager.

Chapter 4, Using the Core Helpers, discovers the plethora of core helper files that come included with concrete5.

Chapter 5, Working with Databases and Models, explores the backbone of custom concrete5 development by working through database access and learning how to use models.

Chapter 6, Creating CRUD Interfaces, works through a bunch of useful recipes and creates interfaces to manage custom data in concrete5.

Chapter 7, Working with Users and Permissions, takes advantage of concrete5's user and permission model in your own applications and websites.

Chapter 8, Working with Themes and Add-ons, helps us learn how to create custom themes and add-ons, further expanding your concrete5 development skills.

Chapter 9, System Events and Advanced Configuration, uncovers concrete5's powerful developer functionality using advanced configuration settings and by hooking into system events.

Appendix A, Blueprint – Creating an Image Gallery Add-on, starts from scratch and builds an add-on that displays images stored in the file manager.

Appendix B, Blueprint – Creating an Events Calendar Add-on, combines all of the knowledge learned in previous chapters to create a fully functioning calendar add-on, complete with a CRUD interface and custom block type.

Appendix C, Submitting an Add-on Package to the concrete5 Marketplace, helps us to learn about the process that developers must follow to get their add-ons included in the concrete5 marketplace.

What you need for this book

Readers will need a copy of concrete5 running on a development (not production) server. This will allow readers to experiment with many different elements of the concrete5 API without disrupting normal website operation.

Readers will also need a code editor that is capable of editing the PHP files. This can be something like an advanced editor such as Adobe Dreamweaver or a basic text editor, such as Vim.

Some chapters also deal with browsing and querying MySQL databases, so a query browsing tool is recommended. HeidiSQL (on Windows), Sequel Pro (on OS X), and MySQL Workbench (all platforms) are some great tools that provide advanced functionality while browsing databases.

Who this book is for

This book is for beginner to intermediate PHP developers who would like to get to know concrete5 better, or for concrete5 veterans who would like to have a handy desk reference of the concrete5 API.

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: " The Left Sidebar page type, for example, would have a handle of left_sidebar."

A block of code is set as follows:

function my_debug($var) {
  echo '<pre>';
  print_r($var);
  echo '</pre>';
  exit;
}

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 , and mention the book title via 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.

Customer support

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.

Downloading the example code

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.

Errata

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 errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

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 with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.