Explor­ing the Ele­ment Type Mod­el — Part 3 of 3

This recording is Part 3 the first introduction to Element Types in Craft CMS given to a small group of Craft developers. The presentation takes place 2 weeks before Peers 2014 where Brandon's course on Element Types attracted a full house and introduced Element Types to a larger audience.

Part 3 of 3

This recording is the first introduction to Element Types in Craft CMS given to a small group of Craft developers. The presentation takes place 2 weeks before Peers 2014 where Brandon's course on Element Types attracted a full house and introduced Element Types to a larger audience.

A big thanks to Selvin Ortiz for arranging this meetup and to Brandon Kelly for leading it.

  • 00:00:00 Extending BaseElementModel with EventModel
  • 00:01:23 String representation of your Element __toString()
  • 00:02:14 Element Class Handles getElementType()
  • 00:03:26 Element Field Layout and assigning custom fields to your elements getFieldLayout()
  • 00:12:34 Adding URLs for your Element Type getUrlFormat()
  • 00:14:33 Determine which locales your Element Type will support getLocales()
  • 00:14:55 getUrl(), getLink(), getRef(), isEditable(), getCpEditUrl(), getStatus(), getNext(), getPrev(), setNext(), setPrev(), getParent(), setParent() ...
  • 00:18:21 Overview of the custom Events Element Type Model Events_EventModel.php
  • 00:24:17 Templating for Element Types
  • 00:25:55 Creating template variables in a Controller action
  • 00:30:51 Q&A - Element Type Workflow
  • 00:34:27 Q&A - Evolution of Element Types
  • 00:43:39 Q&A - Schema and API changes. i18n, schema, service layer, API
  • 00:54:47 Q&A - Element Criteria Model, using find and first
  • 00:58:19 Q&A - Element Selector Modal and handling sources
  • 01:00:55 Saving Elements
  • 01:14:40 The Event Record Events_EventRecord.php

Level up in Craft CMS with practical examples, snippets, and patterns.
Craft The Planet emails are sent out several times a week.