You are previewing MODx Web Development.
O'Reilly logo
MODx Web Development

Book Description

Build dynamic websites with MODx PHP application framework and CMS

  • Build a complete, feature-rich website using MODx

  • Covers detailed theory from the basics to practical implementation

  • Learn the most common web requirements and solutions, and build a site in the process

  • Simple, step-by-step instructions detailing how to install, configure, and customize MODx

  • In Detail

    MODx is a content management system and PHP web application framework rolled into one. With the ease of a CMS and the extendibility of a framework, MODx allows you to develop professional-looking, intricate websites with its easy-to-use interface and flexible architecture. MODx provides reusable code fragments called snippets, most of which are so generic that, without any modification, they can serve multiple functionalities. The generic nature of the snippets makes it possible to get the perfect customization that is so hard in other CMS.

    This book will get web developers up-and-running with MODx. With step-by-step examples and illustrative screenshots, you will be guided through installation, configuration, and customization. By the end of the book, you will have created a powerful, dynamic website by using the individual elements of MODx, without the need for programming know-how.

    Starting with a walk-through of how to install MODx, you will quickly learn how to develop your site without having to use any programming language. Logical, step-by-step instructions will show you how to create your own unique site by adding and editing documents using the inbuilt TinyMCE editor. You will change the look and feel of your site by creating your own templates using HTML, CSS, and widgets. By following the example of a blog site, you will learn how to extend your templates to allow rich user interactions through comments, posts, and forms. The book teaches a few code snippets such as Ditto and Wayfinder in detail. These powerful and flexible snippets will enable you to add multiple functionalities to your site. The book will also introduce you to many more snippets that will help you build some of the commonly required web functionalities such as forums and image galleries. You will manage your users with authentication and authorization and make your site user-friendly with user groups, forums, and the use of PHx notations to embed logic in templates.

    Through following this easy-to-use, step-by-step guide you will, by the end of the book, have a fully functional, feature-rich MODx site with professional-looking, dynamic web pages that are totally customizable.

    A step-by-step logical guide to building a complete dynamic website using MODx

    Table of Contents

    1. MODx Web Development
      1. Table of Contents
      2. MODx Web Development
      3. Credits
      4. About the Author
      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. What is MODx?
        1. Content management system
          1. Manage content
          2. Content management rules
          3. Define content
        2. An application framework
        3. Web development methodologies
          1. Old school—conventional three tiers
            1. Advantages of the conventional three tiers
            2. Disadvantages of the conventional three tiers
          2. Templating
            1. Advantages of templating
            2. Disadvantages of templating
              1. Application frameworks
            3. Advantages of application frameworks
            4. Disadvantages of application frameworks
          3. Content management systems
            1. Advantages of content management systems
            2. Disadvantages of content management systems
        4. Why MODx?
          1. Why a CMS?
          2. Why an application framework?
          3. So, why MODx?
        5. Overview of the book
        6. Summary
      9. 2. Getting Started
        1. Setting up the development environment
          1. Prerequisites
            1. Linux
            2. Windows
            3. MAC
          2. Verification
        2. Downloading MODx
          1. Installing MODx
            1. Creating a database
            2. Starting the installation
            3. Installation status and diagnostics
        3. Documentation
          1. Official documentation
          2. Community-driven documentation
          3. Combined
        4. Getting support
          1. Web forums
          2. IRC
        5. Summary
      10. 3. MODx Basics
        1. Site configuration
          1. Configuring the site
          2. Default Manager interface page
          3. Noticing and fixing errors and warnings
        2. Changing the name of the site
        3. The basic element of MODx: Resources
          1. Containers
        4. MODx Manager interface
        5. Using the HTML editor
        6. Creating the Front Page
        7. DocManager module
        8. Resources revisited
          1. Editing documents
          2. Resource properties
            1. General tab
            2. Settings
            3. Access permissions
        9. Summary
      11. 4. Templating
        1. Changing the template of a resource
        2. Creating a new template and giving it a category
          1. HTML
          2. CSS
          3. Steps to create the new template
        3. Making the home page use the created template
        4. Choosing a default template
        5. Introducing template variables
        6. Modifying the template to add dynamic behavior
          1. Changing existing templates
        7. Template variables
          1. Creating template variables
          2. Template variable values
          3. Data source binding
          4. Widgets
        8. Creating a blog site
          1. Using a Snippet
          2. Creating a resource
          3. Blog entry
        9. Snippet and chunk basics
          1. Generating output
        10. Using a custom form for the Post a Blog! page
          1. HTML for the custom blog form
          2. Steps to create a chunk
          3. Using a chunk as a form template
          4. Checking the Post a Blog! page
        11. Rich text editor for the blog content
          1. Creating the template variable
          2. Chunk and template variable
          3. NewsEditor and the Rtcontent field
        12. Summary
      12. 5. Authentication and Authorization
        1. Creating a web user
          1. Other user properties
        2. Add the login snippet
        3. Resource group for friends
        4. Restricting access for a resource
          1. User group: Resource group
          2. User: User group
        5. Post moderation
          1. Creating a role
          2. Creating a Manager user
          3. Checking the new role
        6. User registration
          1. Showing a signup form
          2. Joining a default group
          3. Link the signup form in the log in snippet
        7. Snippets and authorization
          1. NewsPublisher and authentication
        8. Summary
      13. 6. Content Aggregation
        1. Ditto
          1. More flexibility with parameters
          2. Aggregated data in a template
          3. Theming MODx—chunks and placeholders
          4. Introducing tagging
            1. Creating a template variable to hold the category
            2. Assigning resources to a category
        2. XML formats
          1. Machine-readable formats and readers
          2. Readers
          3. Ditto and XML formats
            1. Creating RSS views for each category
          4. Filtering
            1. Multiple clauses
          5. Extenders
        3. Summary
      14. 7. Creating Lists
        1. Menu details in document properties
        2. Authentication and authorization
          1. Getting to know WayFinder
        3. Theming
          1. Creating a simple menu
          2. Nested menus
          3. Changing the name in the menu
          4. Doc Manager
            1. Removing pages from the menu
        4. More theming using chunks
          1. Breadcrumb navigation
        5. Multiple calls
        6. Summary
      15. 8. Snippets
        1. Working of snippets
        2. Finding snippets
        3. Learning about snippets
          1. Jot with the minimal configuration
          2. Snippet parameters
          3. Placeholders
        4. Using non-bundled snippets
          1. Installing a snippet
            1. Downloading and extracting a snippet
            2. Adding a snippet
            3. Copying the required files
            4. Using the snippet
            5. Snippet without dependent files
          2. Snippeting skills
        5. Summary
      16. 9. PHx
        1. PHx in action
          1. Installing PHx
          2. Adding Family and Friends resources
            1. Template Code
        2. The PHx notation
          1. Simple usage
          2. Conditional statements
          3. Using the PHx placeholder
          4. Multiple conditions
        3. Summary
      17. 10. Simple Recipes
        1. Forums
          1. Installing SMF
          2. Installing the SMF module
        2. Image gallery
        3. E-mailing from forms
        4. User profiles
          1. Installing WebLoginPE
          2. Edit profile
          3. List users and view their profiles
          4. Link to edit a profile
        5. Similar posts
        6. Summary
      18. 11. Creating Snippets
        1. Learning to create a snippet
          1. Returning output
          2. Returning placeholders
          3. Processing a chunk
          4. Using parameters
        2. MODx API
          1. DBAPI
            1. $MODx->db->select
            2. $MODx->db->getRecordCount
            3. $MODx->db->makeArray
        3. Fortunes
          1. Creating the table
          2. Code for fortunes
          3. Testing the snippet
          4. Chunks, placeholders, and parameters
          5. Using files
        4. Summary
      19. 12. SEO, Deployment, and Security
        1. SEO
          1. Search engine-friendly URLs
          2. Meta tags and keywords
          3. Site map
          4. XHTML Strict
          5. Other SEO tweaks
            1. Using CSS to control the layout
            2. Content first
            3. Hidden text
            4. Descriptive text
            5. Alternative text
            6. Cross links
            7. Tracking
            8. Inbound links
            9. Quality content
        2. Deployment
          1. Filesystem
            1. FTP
            2. SFTP
            3. WebDAV
          2. Database
            1. Exporting
            2. Importing
            3. Configuration file
          3. Configurations
        3. Security
          1. File permissions
          2. Installer
          3. Writable configuration file
          4. Captcha
          5. mod_security
          6. Unused files
          7. Manager configurations
            1. User tab
            2. File Manager tab
        4. Summary
      20. 13. Plugins and Modules
        1. Plugins and events
          1. Using an existing plugin
            1. Configuration
            2. System events
            3. Exploring other plugins
          2. Using custom plugins
            1. Learning about the plugin
          3. Creating plugins
          4. Event-triggering snippets
        2. Modules
          1. Using modules
            1. Creating a module
            2. Executing a module
            3. Module's Manager interface
            4. Dependent plugins
          2. Learning to use custom modules
        3. Summary
      21. 14. MODx Revolution
        1. Why Evolution, why Revolution…
        2. What is similar?
        3. What to expect?
        4. Tags
        5. A peek into Revolution
        6. Core technology changes
          1. xPDO
          2. Sencha and Smarty
        7. Join the community
        8. Summary
      22. Index