Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Introduction

Introduction

At the heart of every Web site project is the need to organize and present content. For the last 10 years, static sites have dominated the Internet landscape, and site maintenance has been a laborious and often frustrating process. Web masters had to cope with thousands of line of HTML code across a mass of Web page files. However, employing a dynamic site required a large amount of custom coding and potential unforeseen security loopholes.

The release of the Joomla content management system (CMS) in 2005 opened a new age of affordable, advanced Web site deployment. Content management was now possible without any programming required, yet the flexibility of the Joomla system allowed the creation of robust add-ons to augment the CMS. As tens of thousands of developers flocked to Joomla and the availability of add-ons reached critical mass (almost 1700 at last count), Joomla became the most important noncommercial CMS in the world. It has become a major force in allowing Web masters to perform site deployment and management without the grueling effort.

This widespread adoption has opened numerous opportunities for professional Joomla developers. With the number of downloads of the Joomla system having surpassed 2.5 million by mid-2007, developers can find a ready audience for their work. Whether you're creating an XHTML-compliant template to sell to a subscription site, providing expert Joomla consulting services, or releasing a Joomla extension into the open source community for widespread adoption, there is a place for you in the wide world of Joomla.

With the diverse needs of professional readers in mind, I wrote this book with the intention that you would turn the last page with an understanding of Joomla second only to full-time developers or the Joomla development team members. Between these covers, I have tried to provide examples of the two main areas of the professional Joomla field: development and deployment.

For development, there are chapters focusing on implementing custom templates, creating all three types of Joomla extensions (modules, components, and plug-ins), utilizing cutting-edge Ajax technology in Joomla add-ons, using a professional development environment with source code control, adopting design patterns for best programming methods, and much more.

You will even be delving into the internal structure of the Joomla framework itself to give you a complete behind-the-scenes education. Learning the fundamentals of the Joomla structure will allow you to better develop add-ons that better take advantage of the riches that Joomla offers.

For deployment, you'll examine the underlying technologies (PHP, Apache, and so on) that can be tuned to offer the best system performance. General administration, search engine optimization (SEO), interfacing with outside content, security configuration, Lightweight Directory Access Protocol (LDAP) authentication setup—all of the topics are covered.

I hope you come away from this book with many ideas for modifying and extending Joomla to meet the needs of yourself and/or your customers. I've spent dozens of hours digging into the underlying code of the Joomla framework and have come away with a vast appreciation of the brilliant work done by the Joomla team. I suspect that the more you work with Joomla, the more you'll share my admiration for this open source wonder.

Who This Book Is For

Professional Joomla! will be appeal to Web developers, hobbyists, Web designers, small and medium-sized businesses, e-commerce merchants, and nonprofit organizations. The broad interest in acquiring professional Joomla skills goes beyond the normal development community, since companies that have adopted Joomla technology host every type of Web site and range from real estate firms to fitness companies to funeral homes.

This book is of particular interest to bloggers, corporate content creators, and support specialists. However, anyone with access to a Web-hosting site that allows PHP/MySQL content deployment (which includes popular sites such as GoDaddy.com, Rochen.com, and SiteGround.com) will be able to deploy a Joomla! site with all of the features shown in this book.

To use this book effectively, you should already have completed at least a basic installation experience with Joomla. If you are already familiar with earlier versions of Joomla, you will have no trouble with any of the techniques or features. Joomla updates retain enough continuity that, aside from menu reorganization, the core aspects of handling a Joomla system have remained unchanged. Programming Joomla has been altered dramatically, however, so be sure to pay close attention to the examples and note boxes that make explicit the new way of doing things.

Additionally, there is a great deal of PHP programming involved, so basic skills in this area are also necessary to harness the power of the instructions of this book. Knowledge of Web server configuration is recommended but not required if you are running your site on a remote host.

With each chapter, I have tried to build on the chapters that precede it. Therefore, although the book can be read nonsequentially, I recommend that you read at least the first six chapters in order. After that, there is a lot more flexibility to skip to areas of particular interest without becoming confused regarding some Joomla-specific topic that was skipped.

What This Book Covers

Joomla! is a free, open source, and cross-platform (Windows, Linux, and MacOS) CMS. This book focuses on the new Joomla version 1.5 and all of the features (not just new ones) that it provides. Wherever possible, I have noted the differences between the previous version 1.0.x and the new version to aid users in making the transition to a new deployment.

The programming and editing tools required to complete the book examples are, like Joomla, free and freely available (aside from the specific implementation demonstrations with programs such as Adobe Dreamweaver and Microsoft Frontpage). For all programs and extensions that are used, I've included the Web address of the individual home pages where they may be downloaded.

How This Book Is Structured

This book is organized in the likely stages of interest that an intermediate Joomla user would want to follow to progress to becoming a professional user. It begins with installation configuration and progresses to extending the Joomla system through the creation of custom templates, modules, components, and plug-ins. What follows are professional deployment issues that are described, from building virtual communities to interfacing with outside content to SEO.

This book includes the following chapters:

  • Chapter 1: "Introducing Joomla" — This chapter describes the various aspects of Joomla that will be embraced by Web masters, Web designers, and Web developers.

  • Chapter 2: "The Finer Points of Installation and Configuration" — This chapter introduces the four servers of a Joomla system (Joomla!, PHP, MySQL, and Apache/IIS), and shows how each may be installed and configured for maximum performance. Additionally, the recommended differences in settings between staging and deployment servers are elaborated.

  • Chapter 3: "Developing Custom Templates" — This chapter steps through the process of creating a custom template from scratch. Template structure is first examined with a primitive Hello World template. This template is then expanded into a comprehensive three-column Joomla template that uses CSS for column layout. Finally, advanced template creation techniques are described, including how to create a template family, generating a custom favicon for the page, and incorporating a cell-phone-centric template.

  • Chapter 4: "Adding and Modifying Available Extensions"—This chapter surveys many available extensions and details their basic configuration and use. The Joomla Extensions Directory (JED) is reviewed, and examples of the various extension categories (Site Features and Management, Organizations and eCommerce, Site Content, and Site Interactivity) are provided.

  • Chapter 5: "Developing Simple Extensions: Modules"—This chapter follows the complete process of creating a module from scratch. Starting with a simple Hello World program, the structure and use of the module extension type is revealed. Two progressively more complex development projects follow with the Holiday Greetings module using a custom table to display definable holiday greetings and the Contact Us module demonstrating access to the native Joomla tables from an extension.

  • Chapter 6: "Advanced Extensions: Components"—This chapter covers the development of a form-based guestbook component. The entire professional development process is covered here from the setup of the Eclipse integrated development environment (IDE) to the use of SVN for source code control to the adoption of php Documentor to automatically generate project documentation.

  • Chapter 7: "Joomla and Ajax"—This chapter demonstrates how to create two Ajax components that can be used to add dynamic data retrieval to Joomla. After the structure of Ajax interaction is outlined, a Joomla-Ajax component is created that can be accessed by any Web page. Moving to a more real-world example, an Ajax module and component package is introduced with the component supplying the back-end connectivity and the Joomla front-end module providing the interactive display.

  • Chapter 8: "Design Patterns and Joomla"—This chapter examines the technique of using conceptual models known as design patterns to solve common programming problems. A number of design patterns are summarized, and their uses in the design of part of the Joomla framework are highlighted. Then, a step-by-step tour of creating a component using the MVC pattern provides an example for adopting design patterns within Joomla development.

  • Chapter 9: "Hooking into the Joomla Foundation: Plug-ins"—This chapter begins by describing the Joomla plug-in system and events that may be registered to activate routines in the plug-in. A Hello World plug-in shows the basic event activation that can add a greeting to an article. Next, you are provided with a guided tour of the creation of a text abbreviation replacement plug-in that can dynamically replace abbreviated text with the expanded text on the fly. This text alteration is performed only on the article display, thereby leaving the content in the database intact. Finally, a general outline of the Joomla framework itself is presented.

  • Chapter 10: "Building Joomla Communities"—This chapter focuses on the process of creating and retaining a virtual community. Beginning with the plan and design phase, the method provides an outline for defining the target audience for a virtual community site. Once the community is determined, various Joomla extensions are examined that can give a Joomla site community features. Further instruction is provided on the best practices for deploying and maintaining the community.

  • Chapter 11: "Managing a Professional Deployment—This chapter describes the measures that you can take to have a successful deployment. In addition to procedures given to setting debugging settings, configuring automated testing, and transferring a Joomla site from a staging/test server to deployment server, tuning information is provided for MySQL and LDAP authentication.

  • Chapter 12: "Interfacing with Outside Content"—This chapter examines extra-site interaction in the form of external content, managing affiliate programs, business interaction via Electronic Data Interchange (EDI), and custom extranet interaction. This chapter demonstrates how to program custom Joomla extensions to address extranet services, and includes a Joomla component that dynamically performs screen scraping, a component to interface to the Google Map service, and an extension to use the USPS.com ZIP code finder service.

  • Chapter 13: "Search Engine Optimization (SEO) and Search Engine Marketing (SEM)"—This chapter covers the techniques and procedures that can be used to tune a Joomla site for both SEO and SEM. In addition to demonstrating the Joomla! SEO configuration parameters, the advantages of using other Joomla features such as metadata, breadcrumbs, and sitemaps are identified, and their importance to SEO is highlighted. A general procedure for optimizing your site is provided, as well as an examination of the effects of technology such as Flash and JavaScript on page ranking.

  • Chapter 14: "Joomla Security"—This chapter introduces many of the best configuration settings to ensure Joomla site security. A summary of the primary types of attacks that may be expected against a Joomla system (as well as remedies for such attacks) is provided. Information regarding security settings for each individual server (Apache/IIS, PHP, MySQL, and Joomla!) is provided.

  • Chapter 15: "What Joomla Can't Do"—This chapter evaluates the major shortcoming of the system when compared with industrial-grade CMS systems. Limited capabilities in the areas of version control, file conversion, security, load balancing, replication, groupware functionality, and portal capabilities are all examined.

  • Chapter 16: "Spotlight on Successful Joomla Sites" — This chapter surveys a variety of popular sites that use Joomla for their Web deployment. Each site summary includes details about the site (such as template used, default screen size, and so on), as well as the third-party extensions the site uses to add functionality.

What You Need to Use This Book

Aside from Joomla (which is available for free download), there are no essential software requirements to use the examples in this book. Perhaps the largest downloadable application demonstrated is the Eclipse IDE, which runs about 230MB and reasonably requires a high-speed connection to retrieve the installer. Other downloads generally fall into the 10MB to 20MB range.

This book was written to be as platform-independent as possible. Because a large majority of interaction with the Joomla system occurs through the Web-based Administrator interface, the instructions will apply, regardless of the operating system or browser used. When configuration details are specific to a particular operating system, I have tried to include the necessary individual instructions for Linux, MacOS, and Windows.

Conventions

To help you get the most from the text and keep track of what's happening, a number of conventions have been used throughout the book.

NOTE

Boxes like this one hold important, not-to-be forgotten information that is directly relevant to the surrounding text.

Tips, hints, tricks, and asides to the current discussion are offset and placed in italics like this.

As for styles in the text:

  • Important new terms and important words are highlighted when we introduce them.

  • Keyboard strokes are shown like this: Ctrl+A.

  • Filenames, URLs, and code within the text are shown like this: persistence.properties.

  • When paths are specified in the body text, the backslash (\) character is used as a directory separator for standardization, although UNIX-based platforms use the forward slash (/) instead.

  • Code is presented in the following two ways:

    In code examples we highlight new and important code with a gray background.
    The gray highlighting is not used for code that's less important in the present
    context, or has been shown before.
    
    					  

Source Code

As you work through the examples in this book, you may choose either to type in all the code manually, or use the source code files that accompany the book. All of the source code used in this book is available for download at www.wrox.com. Once at the site, simply locate the book's title (either by using the Search box or by using one of the title lists), and click the Download Code link on the book's detail page to obtain all the source code for the book.

Because many books have similar titles, you may find it easiest to search by ISBN; for this book the ISBN is 978-0-470-13394-1.

Once you download the code, just decompress it with your favorite compression tool. Alternately, you can go to the main Wrox code download page at www.wrox.com/dynamic/books/download.aspx to see the code available for this book and all other Wrox books.

Errata

We make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books (such as a spelling mistake or faulty piece of code), we would be very grateful for your feedback. By sending in errata you may save another reader hours of frustration and, at the same, time you will be helping us provide even higher-quality information.

To find the errata page for this book, go to www.wrox.com and locate the title using the Search box or one of the title lists. Then, on the book details page, click the Book Errata link. On this page, you can view all errata that has been submitted for this book and posted by Wrox editors. A complete book list including links to each's book's errata is also available at www.wrox.com/misc-pages/booklist.shtml.

If you don't spot "your" error on the Book Errata page, go to www.wrox.com/contact/techsupport.shtml and complete the form there to send us the error you have found. We'll check the information and, if appropriate, post a message to the book's errata page and fix the problem in subsequent editions of the book.

p2p.wrox.com

For author and peer discussion, join the P2P forums at p2p.wrox.com. The forums are a Web-based system for you to post messages relating to Wrox books and related technologies, and to interact with other readers and technology users. The forums offer a subscription feature to email you topics of interest of your choosing when new posts are made to the forums. Wrox authors, editors, other industry experts, and your fellow readers are present on these forums.

At http://p2p.wrox.com, you will find a number of different forums that will help you not only as you read this book but also as you develop your own applications. To join the forums, just follow these steps:

  1. Go to p2p.wrox.com, and click the Register link.

  2. Read the terms of use, and click Agree.

  3. Complete the required information to join, as well as any optional information you wish to provide, and click Submit.

  4. You will receive an email with information describing how to verify your account and complete the joining process.

You can read messages in the forums without joining P2P, but to post your own messages, you must join.

Once you join, you can post new messages and respond to messages other users post. You can read messages at any time on the Web. If you would like to have new messages from a particular forum emailed to you, click the Subscribe to this Forum icon by the forum name in the forum listing.

For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to questions about how the forum software works, as well as many common questions specific to P2P and Wrox books. To read the FAQs, click the FAQ link on any P2P page.