Book Image

CMS Design Using PHP and jQuery

By : Kae Verens
Book Image

CMS Design Using PHP and jQuery

By: Kae Verens

Overview of this book

<p>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.<br /><br />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.<br /><br />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.<br />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.</p> <p>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.<br />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.</p>
Table of Contents (19 chapters)
CMS Design Using PHP and jQuery
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
11
Panels and Widgets — Part Two

Listing pages in the admin area


To begin, we will add Pages to the admin menu. Edit /ww.admin/header.php and add the following highlighted line:

<ul>
<li><a href="/ww.admin/pages.php">Pages</a></li>
<li><a href="/ww.admin/users.php">Users</a></li>

And one more thing when we log into the administration part of the CMS, it makes sense to have the "front page" of the admin area be the Pages section. After all, most of the work in a CMS is done in the Pages section.

So, we change /ww.admin/index.php so it is a synonym for /ww.admin/pages.php. Replace the /ww.admin/index.php file with this:

<?php
require 'pages.php';

Next, let's get started on the Pages section.

First, we will create /ww.admin/pages.php:

<?php
require 'header.php';
echo '<h1>Pages</h1>';
// { load menu
echo '<div class="left-menu">';
require 'pages/menu.php';
echo '</div>';
// }
// { load main page
echo '<div class="has-left-menu">';
require...