concrete5 Cookbook

Over 140 recipes to help you develop websites using the concrete5 content management system
Preview in Mapt

concrete5 Cookbook

David Strack

1 customer reviews
Over 140 recipes to help you develop websites using the concrete5 content management system
Mapt Subscription
FREE
$29.99/m after trial
eBook
$18.90
RRP $26.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$18.90
$44.99
$29.99p/m after trial
RRP $26.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


concrete5 Cookbook Book Cover
concrete5 Cookbook
$ 26.99
$ 18.90
concrete5: Beginner's Guide - Second Edition Book Cover
concrete5: Beginner's Guide - Second Edition
$ 26.99
$ 18.90
Buy 2 for $35.00
Save $18.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781782164548
Paperback296 pages

Book Description

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

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

What You Will Learn

  • 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

Authors

Table of Contents

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

Book Details

ISBN 139781782164548
Paperback296 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Creating Concrete5 Themes Book Cover
Creating Concrete5 Themes
$ 12.99
$ 9.10
concrete5: Beginner's Guide - Second Edition Book Cover
concrete5: Beginner's Guide - Second Edition
$ 26.99
$ 18.90
concrete5 Beginner's Guide Book Cover
concrete5 Beginner's Guide
$ 26.99
$ 18.90
Responsive Web Design with HTML5 and CSS3 Book Cover
Responsive Web Design with HTML5 and CSS3
$ 23.99
$ 4.80
Choosing an Open Source CMS: Beginner's Guide Book Cover
Choosing an Open Source CMS: Beginner's Guide
$ 23.99
$ 16.80
ODP.NET Developer's Guide: Oracle Database 10g Development with Visual Studio 2005 and the Oracle Data Provider for .NET Book Cover
ODP.NET Developer's Guide: Oracle Database 10g Development with Visual Studio 2005 and the Oracle Data Provider for .NET
$ 29.99
$ 21.00