O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CMS Design Using PHP and jQuery

Book Description

Build and improve your in-house PHP CMS by enhancing it with jQuery

  • Create a completely functional and a professional looking CMS

  • Add a modular architecture to your CMS and create template-driven web designs

  • Use jQuery plugins to enhance the "feel" of your CMS

  • A step-by-step explanatory tutorial to get your hands dirty in building your own CMS

  • In Detail

    PHP and JQuery are two of the most famous open source tools used for web development. This book will explain how to leverage their power by building a core CMS, which can be used for most projects without needing to be changed, and how to add custom plugins that can then be tailored to the individual project.

    This book walks you through the creation of a CMS core, including basic page creation and user management, followed by a plugin architecture, and example plugins. Using the methods described in this book, you will find that you can create distinctly different websites and web projects using one codebase, web design templates, and custom-written plugins for any site-specific differences. Example code and explanation is provided for the entire project.

    This book describes how to use PHP, MySQL, and jQuery to build an entire CMS from the ground up, complete with plugin architecture, user management, template-driven site design, and an installer. Each chapter walks you through the problems of various aspects of CMS design and their solutions, with example code and explanation provided for the chosen solutions.

    A plugin architecture is explained and built, which allows you to enhance your own CMS by adding site-specific code that doesn't involve "hacking" the core CMS. By the end of the book, you will have developed a full CMS, which can be used to create a large variety of different site designs and capabilities.

    An in-depth walk-through in building a PHP and jQuery plugin-based CMS project.

    Table of Contents

    1. CMS Design Using PHP and jQuery
      1. CMS Design Using PHP and jQuery
      2. Credits
      3. About the Author
      4. Acknowledgement
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Errata
          2. Piracy
          3. Questions
      8. 1. CMS Core Design
        1. The CMS's private and public areas
          1. The front-end
          2. The admin area
        2. Plugins
        3. Files and databases
          1. Directory structure
          2. Database structure
          3. The configuration file
        4. Hello World
          1. Setup
          2. Front controller
          3. Reading page data from the database
        5. Summary
      9. 2. User Management
        1. Types of users
        2. Roles
        3. Database tables
        4. Admin area login page
        5. Logging in
        6. Logging out
        7. Forgotten passwords
        8. User management
          1. Deleting a user
          2. Creating or editing a user
        9. Summary
      10. 3. Page Management — Part One
        1. How pages work in a CMS
        2. Listing pages in the admin area
          1. Hierarchical viewing of pages
          2. Moving and rearranging pages
        3. Administration of pages
          1. Filling the parent selectbox asynchronously
        4. Summary
      11. 4. Page Management — Part Two
        1. Dates
        2. Saving the page
        3. Creating new top-level pages
          1. Creating new sub-pages
        4. Deleting pages
        5. Rich-text editing using CKeditor
          1. File management using KFM
        6. Summary
      12. 5. Design Templates — Part One
        1. How do themes and templates work?
          1. File layout of a theme
          2. Setting up Smarty
          3. Front-end navigation menu
        2. Summary
      13. 6. Design Templates — Part Two
        1. Adding jQuery to the menu
          1. Preparing the Filament Group Menu
          2. Integrating the menu
          3. Choosing a theme in the administration area
          4. Choosing a page template in the administration area
          5. Running Smarty on page content
        2. Summary
      14. 7. Plugins
        1. What are plugins?
          1. Events in the CMS
          2. Page types
          3. Admin sections
          4. Page admin form additions
        2. Example plugin configuration
        3. Enabling plugins
        4. Handling upgrades and database tables
        5. Custom admin area menu
        6. Adding an event to the CMS
        7. Adding tabs to the page admin
        8. Summary
      15. 8. Forms Plugin
        1. How it will work
        2. The plugin config
        3. Page types in the admin
        4. Adding custom content forms to the page admin
        5. Defining the form fields
        6. Showing the form on the front-end
        7. Handling the submission of the form
          1. Sending by e-mail
          2. Saving in the database
        8. Exporting saved data
        9. Summary
      16. 9. Image Gallery Plugin
        1. Plugin configuration
        2. Page Admin tabs
        3. Initial settings
        4. Uploading the Images
          1. Handling the uploads
          2. Adding a kfmget mod_rewrite rule
          3. Deleting images
        5. Front-end gallery display
        6. Settings tab
        7. Grid-based gallery
        8. Summary
      17. 10. Panels and Widgets — Part One
        1. Creating the panel plugin
        2. Registering a panel
        3. The panel admin area
          1. Showing panels
        4. Creating the content snippet plugin
        5. Adding widgets to panels
          1. Showing widgets
          2. Dragging widgets into panels
          3. Saving panel contents
        6. Showing panels on the front-end
        7. Summary
      18. 11. Panels and Widgets — Part Two
        1. Widget forms
          1. Saving the snippet content
          2. Renaming widgets
          3. Widget header visibility
          4. Disabling widgets
          5. Disabling a panel
          6. Deleting a panel
          7. Panel page visibility—admin area code
          8. Panel page visibility—front-end code
          9. Widget page visibility
        2. Summary
      19. 12. Building an Installer
        1. Installing a virtual machine
          1. Installing VirtualBox
          2. Installing the virtual machine
          3. Installing the CMS in the VM
        2. Creating the installer application
          1. Core system changes
          2. The installer
        3. Checking for missing features
        4. Adding the configuration details
        5. Summary