Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Craft CMS Summit 2014: Element Types & Plugin Development

Craft CMS Summit 2014: Element Types & Plugin Development

Ben Croker

June 17, 2014
Tweet

More Decks by Ben Croker

Other Decks in Technology

Transcript

  1. Element Types &
    Plugin Development
    Ben Croker • @ben_pylo • Craft CMS Summit 2014

    View full-size slide

  2. ExpressionEngine Add-Ons
    Craft Plugins

    View full-size slide

  3. Lead Developer

    View full-size slide

  4. Dublin (Ireland)
    !
    Vienna (Austria)

    View full-size slide

  5. Craft’s Architecture

    View full-size slide

  6. Caching • Logging • Validation • Authentication • Internationalisation

    View full-size slide

  7. Controller
    Model View
    Request

    View full-size slide

  8. Controller
    View
    Record
    Database
    Controller Layer
    Data Layer
    Request

    View full-size slide

  9. Controller
    Template
    Request
    Service
    Services
    Record
    Database
    Controller Layer
    Service Layer
    Data Layer
    Router
    Request
    Routing Layer

    View full-size slide

  10. Controller
    Template
    Request
    Service
    Services
    Record
    Database
    Controller Layer
    Service Layer
    Data Layer
    Router
    Request
    Routing Layer

    View full-size slide

  11. Resource Request
    URI contains resource trigger (“cpresources” by default)
    Action Request *
    URI contains action trigger (“actions” by default) or “action” parameter
    Element Request
    URI matches that of an element (entry, category or plugin)
    Dynamic Route
    URI matches a dynamic route in routes.php or as defined in control panel
    Template
    URI is a valid template path
    404
    URI cannot be resolved

    View full-size slide

  12. Plugin Development

    View full-size slide

  13. validator
    controllers
    elementtypes
    fieldtypes
    models
    records
    resources
    services
    templates
    variables
    ValidatorPlugin.php

    View full-size slide

  14. Sample Plugins

    View full-size slide

  15. Element Types

    View full-size slide

  16. app
    elementtypes
    AssetElementType.php
    CategoryElementType.php
    EntryElementType.php
    GlobalSetElementType.php
    MatrixBlockElementType.php
    TagElementType.php
    UserElementType.php

    View full-size slide

  17. Localisable
    Filterable
    Relatable
    Linkable

    View full-size slide

  18. Products & Orders = Entries
    Products = Entries; Orders = Distinct
    Products & Orders = Distinct

    View full-size slide

  19. Products & Orders = Native Elements

    View full-size slide

  20. Unified Elemental Content Type
    Consistent User Experience

    View full-size slide

  21. What you knew before
    !
    Craft

    View full-size slide

  22. Thank You
    Ben Croker • @ben_pylo • Craft CMS Summit 2014

    View full-size slide