concrete5 Cookbook


concrete5 Cookbook
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
$21.59
save 20%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
$44.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Recipes for developing websites with concrete5, a popular open source content management system
  • A useful guide for concrete5 novices and experts alike
  • Contains blueprints of selected projects explained extensively with a top-to-bottom approach

Book Details

Language : English
Paperback : 296 pages [ 235mm x 191mm ]
Release Date : July 2013
ISBN : 1782164545
ISBN 13 : 9781782164548
Author(s) : David Strack
Topics and Technologies : All Books, CMS and eCommerce, Cookbooks, Content Management (CMS), Open Source, Web Development

Table of Contents

Preface
Chapter 1: Pages and Page Types
Chapter 2: Working with Blocks
Chapter 3: Files and File Sets
Chapter 4: Using the Core Helpers
Chapter 5: Working with Databases and Models
Chapter 6: Creating CRUD Interfaces
Chapter 7: Working with Users and Permissions
Chapter 8: Working with Themes and Add-ons
Chapter 9: System Events and Advanced Configuration
Appendix A: Blueprint – Creating an Image Gallery Add-on
Appendix B: Blueprint – Creating an Events Calendar Add-on
Appendix C: Submitting an Add-on Package to the concrete5 Marketplace
Index
  • Chapter 1: Pages and Page Types
    • Introduction
    • Create a custom debugging function
    • Getting the current Page object
    • Getting a Page object by its ID
    • Getting a Page object by its path
    • Getting a page type by its ID
    • Getting a page type by its handle
    • Getting a page type's ID
    • Getting a page type's name
    • Getting a page type's handle
    • Getting the icon for a page type
    • Getting a list of pages that belong to a page type
    • Creating a page type
    • Updating a page type
    • Deleting a page type
    • Creating a page type
    • Updating an existing page
    • Setting page attributes
    • Getting a page attribute
    • Getting a page's ID
    • Getting a page's path
    • Getting a page's handle
    • Getting a page's name
    • Getting a page's description
    • Getting a page's page type ID
    • Getting a page's page type handle
    • Getting a page's theme object
    • Getting the children below a page
    • Moving a page
    • Deleting a page (and its children)
    • Getting a list of pages
    • Adding a page selector field to a form
    • Chapter 2: Working with Blocks
      • Introduction
      • Creating a custom block type
      • Using block controller callback functions
      • Sending variables from the controller to the view
      • Adding items to the page header and footer from the block controller
      • Creating custom block templates
      • Including JavaScript in block forms
      • Including JavaScript in the block view
      • Including CSS in the block view
      • Loading a block type by its handle
      • Adding a block to a page
      • Getting the blocks from an area
      • Chapter 3: Files and File Sets
        • Introduction
        • Loading a file by its ID
        • Getting a file's path
        • Getting a list of files
        • Uploading a file to the file manager
        • Loading a file set by its ID
        • Adding a file to a file set
        • Removing a file from a file set
        • Checking if a file is part of a file set
        • Getting all of the files in a file set
        • Duplicating a file
        • Deleting a file
        • Reindexing a file's search attributes
        • Setting passwords on file objects
        • Setting permissions on files
        • Getting the download URL for a file
        • Getting the download statistics for a file
        • Adding a file picker to a form
        • Chapter 4: Using the Core Helpers
          • Introduction
          • Loading a helper class
          • Using the Date helper
          • Using the Encryption helper
          • Loading an RSS feed with the Feed helper
          • Managing files and directories with the File helper
          • Creating custom forms with the Form helper
          • Including a WYSIWYG editor on a form
          • Generating HTML code with the HTML helper
          • Generating and caching thumbnails with the Image helper
          • Encoding and decoding JSON with the JSON helper
          • Sending e-mails with the Mail helper
          • Determining the MIME type of a file extension using the MIME helper
          • Getting page URLs and breadcrumbs with the Navigation helper
          • Working with strings using the Text helper
          • Generating URLs with the URL helper
          • Validating input data using the Validation helpers
          • Preventing spam using the Captcha helper
          • Getting a list of countries
          • Getting a list of states and provinces
          • Showing a color picker on a form
          • Showing a date/time selector on a form
          • Showing a rating widget on a form
          • Using the banned words list
          • Reading and writing to the system cache
          • Writing to the debug log
          • Reading and writing to the configuration registry
          • Chapter 5: Working with Databases and Models
            • Introduction
            • Loading the database object
            • Retrieving data from the database
            • Writing data to the database
            • Guarding against SQL injections using prepared statements
            • Creating a custom model class
            • Reading from the database with active record
            • Writing to the database with active record
            • Updating a database record with active record
            • Searching the database using active record
            • Deleting objects using active record and model classes
            • Defining relationships with active record
            • Chapter 6: Creating CRUD Interfaces
              • Introduction
              • Creating controller files for single pages on the dashboard
              • Creating view files for single pages on the dashboard
              • Adding single pages to the dashboard
              • Creating a form to create items
              • Saving data to the database from a controller
              • Creating a view to display a list of database items
              • Adding editing capabilities to create a form
              • Creating a delete action
              • Chapter 7: Working with Users and Permissions
                • Introduction
                • Checking if the current user is logged in
                • Getting the currently logged-in user
                • Loading a user by its ID
                • Loading a user by its username
                • Getting a user's info
                • Setting a user's attributes
                • Retrieving a user's attributes
                • Loading a group by its ID
                • Loading a group by its name
                • Adding a user to a group
                • Getting all of the users from a group
                • Checking if a user is a member of a group
                • Removing a user from a group
                • Logging out a user
                • Deleting a user
                • Getting the permission object
                • Checking if a user can read a page
                • Checking if a user can edit a page
                • Checking a user's file permissions
                • Chapter 8: Working with Themes and Add-ons
                  • Introduction
                  • Creating a custom theme
                  • Including the concrete5 required scripts and styles
                  • Defining editable content areas
                  • Creating page type templates
                  • Using elements for repeated portions of HTML
                  • Customizing system pages
                  • Creating a custom add-on package
                  • Using the package controller to execute custom code
                  • Chapter 9: System Events and Advanced Configuration
                    • Introduction
                    • Declaring advanced configuration variables
                    • Enabling events in concrete5
                    • Listening to system events
                    • Passing parameters to event handlers
                    • Defining a page type event
                    • Sending an e-mail when a user creates an account
                    • Sending an e-mail when a file has been uploaded
                    • Creating a custom scheduled job
                    • Making your add-on translation ready
                    • Rebranding concrete5 as a white label CMS
                    • Changing the dashboard background image
                      • Appendix B: Blueprint – Creating an Events Calendar Add-on
                        • Before we begin...
                        • Creating the package
                        • Installing the package
                        • Creating the list single page
                        • Creating the add form single page
                        • Adding events to the database
                        • Adding a delete confirmation
                        • Creating the custom block type
                        • Adding the block to a page
                        • Wrapping up

                          David Strack

                          David Strack has been a software engineer for over 10 years. With a strong background in HTML, PHP, and JavaScript, he has developed websites for dozens of companies, large and small. David currently works for a small startup in California creating energy analytics software. He lives in Milwaukee, Wisconsin, with his wife, Sarah, and their crazy dog, Brewski. David can usually be found hacking away with JavaScript, designing mobile apps, watching pro football, and drinking craft beer.

                          Sorry, we don't have any reviews for this title yet.

                          Code Downloads

                          Download the code and support files for this book.


                          Submit Errata

                          Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                          Errata

                          - 3 submitted: last submission 16 Jun 2014

                          Errata Category: Code Page number: 154 Chapter number: 6

                          On this page the code in step number 6 is: $this->set($post, (array) $post);

                          It should actually be: $this->set('post', (array) $post);

                          Errata Category: Code Page number: 154 Chapter number: 6

                          In step number 9 the code line is:

                          $post->post_date = date('YYYY-MM-DD H:i:s');

                          It should be:

                          $post->post_date = date('Y-m-d H:i:s');

                          Errata: Code related | Page: 127

                          Error: Step 5 appears as:
                          $results = $db->getAll($query, $db->getAll($query, $db->getAll($query, 
                          $db->getAll($query, $db->getAll($query,
                          Should be:
                          $results = $db->getAll($query, $username);

                          Sample chapters

                          You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                          Frequently bought together

                          concrete5 Cookbook +    Oracle E-Business Suite 12 Financials Cookbook =
                          50% Off
                          the second eBook
                          Price for both: £31.45

                          Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                          What you will learn from this book

                          • Manage pages and the sitemap
                          • Connect to and query the database
                          • Code real data models with Active Record
                          • Produce custom dashboard interfaces
                          • Make a custom theme
                          • Hooke into system events
                          • Create an image gallery add-on
                          • Sell add-ons in the concrete5 marketplace and earn money

                          In Detail

                          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.

                          Approach

                          The Cookbook-style recipes allow you to go both directly to your topic of interest or follow topics throughout a chapter to gain in-depth knowledge. This practical Cookbook will cater to the needs of both intermediate and advanced concrete5 developers.

                          Who this book is for

                          This book is geared towards intermediate to advanced PHP developers who would like to learn more about the concrete5 content management system. Developers already familiar with concrete5 will learn new time-saving tricks and will find the book to be a great reference tool.

                          Code Download and Errata
                          Packt Anytime, Anywhere
                          Register Books
                          Print Upgrades
                          eBook Downloads
                          Video Support
                          Contact Us
                          Awards Voting Nominations Previous Winners
                          Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                          Resources
                          Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software