You are previewing TYPO3 Extension Development.
O'Reilly logo
TYPO3 Extension Development

Book Description

Developer's guide to creating feature rich extensions using the TYPO3 API

  • Covers the complete extension development process from planning and extension generation through development to writing documentation

  • Includes both front-end and back-end development

  • Describes TYPO3 areas not covered in the official documentation (such as using AJAX and eID)

  • Hands on style, lots of examples, and detailed walkthroughs

  • Written by Dmitry Dulepov, TYPO3 core developer and developer of TYPO3 extensions such as RealURL and TemplaVoila

In Detail

TYPO3 is the enterprise-level content management system for the Web. It is large, feature-rich and very flexible—a lot of this flexibility comes through extensions written by the community. Extensions make it possible to use TYPO3 to drive any type of website, including e-commerce, blogs, social networks, catalogs, and many more. TYPO3 can be completely customized using extensions; however creating an extension can be a challenging task.

This book describes TYPO3 extension creation as it should be done. It starts from an overview of the TYPO3 API and provides recommendations on when and how to use this extensive API. Next it describes the TYPO3 extension generation process. It covers all generation options and emphasizes important decisions that extension developers should be aware of.

Since front-end plugins are the most popular TYPO3 extension type, the book has a chapter dedicated to the process of programming front-end plugins. We then move on to back-end plugin programming. All chapters stress best practices and come with unique tips from the author, who wants his experience to be shared with the TYPO3 community. The book finishes with a chapter about improving code and writing documentation.

Table of Contents

  1. TYPO3 Extension Development
  2. Credits
  3. About the Author
  4. About the Reviewer
  5. Preface
    1. What This Book Covers
    2. What You Need for This Book
    3. Who is This Book For
    4. Conventions
    5. Reader Feedback
    6. Customer Support
      1. Downloading the Example Code for the Book
      2. Errata
      3. Piracy
      4. Questions
  6. 1. About TYPO3 API
    1. Overview of TYPO3 API
    2. PHP Classes and Files
      1. t3lib_
      2. tslib_
      3. tx_
      4. ux_
      5. user_
    3. How Data Is Stored in TYPO3
    4. Common TYPO3 API
      1. Database API
      2. Extension Management
      3. Helper Functions (t3lib_div)
        1. GET/POST Functions
        2. String Functions
        3. Array Functions
        4. XML Processing
        5. File, Directory, and URL Functions
        6. Debug Functions
        7. System Functions
        8. TYPO3-Specific Functions
        9. TYPO3 File References
      4. Language Support
      5. Reference Index
      6. Hooks
    5. Backend API
      1. TCEforms
      2. TCEmain
        1. Record Manipulation
        2. Clearing Cache
    6. Frontend API
      1. TSFE
      2. Content Objects
      3. Plugin API
    7. Summary
  7. 2. Anatomy of TYPO3 Extension
    1. TYPO3 Extension Categories
      1. Category: Frontend
      2. Category: Frontend plugins
      3. Category: Backend
      4. Category: Backend module
      5. Category: Services
      6. Category: Examples
      7. Category: Templates
      8. Category: Documentation
      9. Category: Miscellaneous
    2. Extension Files
      1. Common Files
        1. ext_emconf.php
        2. ext_conf_template.txt
        3. ext_tables.php
        4. ext_tables.sql
        5. ext_tables_static+adt.sql
        6. ext_localconf.php
        7. ext_icon.gif
        8. tca.php
        9. class.ext_update.php
      2. Frontend Plugin Files
        1. pi Files
        2. TypoScript Templates
      3. Backend Module and its Files
      4. Module Function Files
      5. Documentation Files
    3. Summary
  8. 3. Planning Extensions
    1. Why is Planning Important?
    2. How to Plan
      1. Gathering Requirements
      2. Implementation Planning
      3. Documentation Planning
    3. TYPO3-Specific Planning
      1. Extension Keys
      2. Database Structure
        1. Field Names
        2. Indexes
        3. Database Relations
    4. Planning Our Extension
      1. Requirements
        1. Functionality
        2. Usability and Expandability
        3. Technical
      2. Extension key
      3. Frontend Plugins
      4. Backend Module
      5. Other Classes
      6. Extension Database Structure
      7. Documentation
    5. Summary
  9. 4. Generating Extensions
    1. Why Generation?
    2. Preparing for Generation
    3. Generation Steps
      1. Entering an Extension key
      2. Entering Extension Information
      3. Set Up Languages
      4. Creating New Database Tables
      5. Extending Existing Tables
      6. Creating Frontend Plugins
      7. Creating Backend Modules
      8. Integrating into Existing Modules
      9. Adding Clickmenu Items
      10. Creating Services
      11. Static TypoScript Code
      12. Adding TSConfig
      13. Generating the Extension
    4. Adjusting Extensions
      1. Clean Up
      2. Changing Fields
      3. Hide Tables
    5. Summary
  10. 5. Frontend Plugin: An In-Depth Study
    1. Frontend Plugins: The Basics
      1. Concepts
      2. Plugin Configuration
        1. TypoScript Configuration
        2. Flexform Configuration
    2. Templating
    3. Localization
      1. Being Localization-Aware
      2. Localizing Strings
      3. Fetching Localized Records
      4. Character Set Handling
    4. Caching
      1. Caching in TYPO3
      2. Cached and Non-Cached Output
      3. Using cHash
      4. Two Things to Avoid
        1. no_cache=1
        2. set_no_cache()
      5. Advanced: Embedding USER_INT into USER
    5. Summary
  11. 6. Programming Frontend Plugins
    1. Review and Update Generated Files
      1. Frontend Plugin Files
        1. class.tx_feuserlist_pi1.php
        2. locallang.xml
      2. Other Related Files
        1. TypoScript Files
        2. ext_localconf.php
        3. ext_tables.php
      3. Non-Reviewed Files
    2. Clean Up Extension
    3. Programming the Plugin
      1. General Workflow
      2. Adding Files
        1. Templates
        2. Flexform Configuration
        3. eID
      3. Defining Functions
      4. Initializing an Extension
        1. Checking the Environment
        2. Loading Configuration
      5. Modifying the Flexform Data Source
      6. Dispatching Calls
      7. Using Templates
        1. Template Basics
        2. Using Templates
      8. Creating a Single view
        1. Creating a Template
        2. Adding stdWrap for Fields
        3. Programming Single View
      9. Creating a List View
        1. Creating a Template
        2. Modifying the TypoScript Template
        3. Programming List View
        4. What is Missing in the List View
      10. Creating Search
        1. Including Styles and Scripts
        2. Adding a Search Box to the Template
        3. Adding a Search Condition
        4. What About Cache?
        5. Creating JavaScript for Autocomplete
        6. Creating PHP Code for Autocomplete
      11. Adding Hooks
      12. What Can Be Optimized?
    4. Summary
  12. 7. Programming Backend Modules
    1. Planning a Backend Module
      1. Functionality of a Backend Module
      2. Frontend Classes
      3. Database Structure
    2. Adjusting the Database
      1. ext_tables.sql
      2. ext_tables.php
      3. tca.php
        1. Columns
        2. Types
        3. Palettes
    3. Implementing a Frontend Hook
    4. Backend Modules: The Basics
      1. What Is a Backend Module?
      2. Module Functions
      3. Backend Module Files
      4. Backend API
        1. t3lib_BEfunc
        2. t3lib_TCEmain
        3. t3lib_TCEforms
        4. t3lib_htmlmail
        5. t3lib_refindex
        6. $BE_USER
    5. Implementing a Backend Module
      1. Files and Classes
      2. A Note about Backend HTML
      3. Implementing the Main Class
      4. Implementing the List of Last Logins
      5. Implementing Monthly View
      6. Implementing a List of Active Users
      7. Implementing Page Statistics
    6. Summary
  13. 8. Finalizing Extensions
    1. Overview
    2. Updating Code Files
      1. Checking the Code
      2. Using extdeveval to Beautify your Code
      3. Script Documentation
      4. Adding a Function Index
      5. Reformatting the Code
    3. Writing Documentation (Extension Manual)
      1. Documentation Template
      2. Template Structure
      3. Styles in the Template
      4. Images in the Documentation
      5. Writing Documentation
      6. Making Documentation Available
    4. Uploading Extensions to TER
    5. Summary